TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
BackendUtility Class Reference
Inheritance diagram for BackendUtility:
BackendUtilityFixture LabelFromItemListMergedReturnsCorrectFieldsFixture ProcessedValueForGroupWithMultipleAllowedTablesFixture ProcessedValueForGroupWithOneAllowedTableFixture ProcessedValueForSelectWithMMRelationFixture

Static Public Member Functions

static deleteClause ($table, $tableAlias= '')
 
static getRecord ($table, $uid, $fields= '*', $where= '', $useDeleteClause=true)
 
static getRecordWSOL ($table, $uid, $fields= '*', $where= '', $useDeleteClause=true, $unsetMovePointers=false)
 
static getRecordRaw ($table, $where= '', $fields= '*')
 
static getRecordsByField ($theTable, $theField, $theValue, $whereClause= '', $groupBy= '', $orderBy= '', $limit= '', $useDeleteClause=true, $queryBuilder=null)
 
static splitTable_Uid ($str)
 
static getSQLselectableList ($in_list, $tablename, $default_tablename)
 
static BEenableFields ($table, $inv=false)
 
static getRecordLocalization ($table, $uid, $language, $andWhereClause= '')
 
static BEgetRootLine ($uid, $clause= '', $workspaceOL=false)
 
static openPageTree ($pid, $clearExpansion)
 
static getRecordPath ($uid, $clause, $titleLimit, $fullTitleLimit=0)
 
static getOriginalTranslationTable ($table)
 
static isTableLocalizable ($table)
 
static getInlineLocalizationMode ($table, $fieldOrConfig)
 
static readPageAccess ($id, $perms_clause)
 
static getTCAtypes ($table, $rec, $useFieldNameAsKey=false)
 
static getTCAtypeValue ($table, $row)
 
static getSpecConfParts ($defaultExtrasString)
 
static getSpecConfParametersFromArray ($pArr)
 
static getFlexFormDS ($conf, $row, $table, $fieldName= '', $WSOL=true, $newRecordPidValue=0)
 
static getPagesTSconfig ($id, $rootLine=null, $returnPartArray=false)
 
static getUserNames ($fields= 'username, usergroup, usergroup_cached_list, uid', $where= '')
 
static getGroupNames ($fields= 'title, uid', $where= '')
 
static getListGroupNames ($fields= 'title, uid')
 
static blindUserNames ($usernames, $groupArray, $excludeBlindedFlag=false)
 
static blindGroupNames ($groups, $groupArray, $excludeBlindedFlag=false)
 
static daysUntil ($tstamp)
 
static date ($tstamp)
 
static datetime ($value)
 
static time ($value, $withSeconds=true)
 
static calcAge ($seconds, $labels= 'min|hrs|days|yrs|min|hour|day|year')
 
static dateTimeAge ($tstamp, $prefix=1, $date= '')
 
static titleAltAttrib ($content)
 
static titleAttribForPages ($row, $perms_clause= '', $includeAttrib=true)
 
static getRecordToolTip (array $row, $table= 'pages')
 
static getRecordIconAltText ($row, $table= 'pages')
 
static getLabelFromItemlist ($table, $col, $key)
 
static getLabelFromItemListMerged ($pageId, $table, $column, $key)
 
static getLabelsFromItemsList ($table, $column, $keyList, array $columnTsConfig=[])
 
static getItemLabel ($table, $col)
 
static getRecordTitle ($table, $row, $prep=false, $forceResult=true)
 
static getRecordTitlePrep ($title, $titleLength=0)
 
static getNoRecordTitle ($prep=false)
 
static getProcessedValueExtra ($table, $fN, $fV, $fixed_lgd_chars=0, $uid=0, $forceResult=true, $pid=0)
 
static getCommonSelectFields ($table, $prefix= '', $fields=[])
 
static makeConfigForm ($configArray, $defaults, $dataPrefix)
 
static helpTextArray ($table, $field)
 
static cshItem ($table, $field, $_= '', $wrap= '')
 
static editOnClick ($params, $_= '', $requestUri= '')
 
static viewOnClick ($pageUid, $backPath= '', $rootLine=null, $anchorSection= '', $alternativeUrl= '', $additionalGetVars= '', $switchFocus=true)
 
static wrapClickMenuOnIcon ($content, $table, $uid=0, $listFrame=true, $addParams= '', $enDisItems= '', $returnTagParameters=false)
 
static getLinkToDataHandlerAction ($parameters, $redirectUrl= '')
 
static getModTSconfig ($id, $TSref)
 
static getFuncMenu ($mainParams, $elementName, $currentValue, $menuItems, $script= '', $addParams= '')
 
static getDropdownMenu ($mainParams, $elementName, $currentValue, $menuItems, $script= '', $addParams= '')
 
static getFuncCheck ($mainParams, $elementName, $currentValue, $script= '', $addParams= '', $tagParams= '')
 
static getFuncInput ($mainParams, $elementName, $currentValue, $size=10, $script= '', $addParams= '')
 
static unsetMenuItems ($modTSconfig, $itemArray, $TSref)
 
static setUpdateSignal ($set= '', $params= '')
 
static getUpdateSignalCode ()
 
static getModuleData ($MOD_MENU, $CHANGED_SETTINGS, $modName, $type= '', $dontValidateList= '', $setDefaultList= '')
 
static lockRecords ($table= '', $uid=0, $pid=0)
 
static isRecordLocked ($table, $uid)
 
static getTCEFORM_TSconfig ($table, $row)
 
static getTSconfig_pidValue ($table, $uid, $pid)
 
static getPidForModTSconfig ($table, $uid, $pid)
 
static getTSCpidCached ($table, $uid, $pid)
 
static getTSCpid ($table, $uid, $pid)
 
static firstDomainRecord ($rootLine)
 
static getDomainStartPage ($domain, $path= '')
 
static RTEsetup ($RTEprop, $table, $field, $type= '')
 
static & softRefParserObj ($spKey)
 
static explodeSoftRefParserList ($parserList)
 
static isModuleSetInTBE_MODULES ($modName)
 
static referenceCount ($table, $ref, $msg= '', $count=null)
 
static translationCount ($table, $ref, $msg= '')
 
static selectVersionsOfRecord ($table, $uid, $fields= '*', $workspace=0, $includeDeletedRecords=false, $row=null)
 
static fixVersioningPid ($table, &$rr, $ignoreWorkspaceMatch=false)
 
static workspaceOL ($table, &$row, $wsid=-99, $unsetMovePointers=false)
 
static movePlhOL ($table, &$row)
 
static getWorkspaceVersionOfRecord ($workspace, $table, $uid, $fields= '*')
 
static getLiveVersionOfRecord ($table, $uid, $fields= '*')
 
static getLiveVersionIdOfRecord ($table, $uid)
 
static versioningPlaceholderClause ($table)
 
static getWorkspaceWhereClause ($table, $workspaceId=null)
 
static wsMapId ($table, $uid)
 
static getMovePlaceholder ($table, $uid, $fields= '*', $workspace=null)
 
static TYPO3_copyRightNotice ()
 
static processParams ($params)
 
static getBackendScript ($interface= '')
 
static isTableWorkspaceEnabled ($table)
 
static getTcaFieldConfiguration ($table, $field)
 
static isWebMountRestrictionIgnored ($table)
 
static isRootLevelRestrictionIgnored ($table)
 
static shortcutExists ($url)
 

Static Protected Member Functions

static getPageForRootline ($uid, $clause, $workspaceOL)
 
static getRecordsSortedByTitle (array $fields, $table, $titleField, $where= '')
 
static replaceL10nModeFields ($table, array $row)
 
static createPreviewUrl ($pageUid, $rootLine, $anchorSection, $additionalGetVars, $viewScript)
 
static buildScriptUrl ($mainParams, $addParams, $script= '')
 
static getRuntimeCache ()
 
static getSignalSlotDispatcher ()
 
static emitGetPagesTSconfigPreIncludeSignal (array $TSdataArray, $id, array $rootLine, $returnPartArray)
 
static getConnectionForTable ($table)
 
static getQueryBuilderForTable ($table)
 
static getLanguageService ()
 
static getBackendUserAuthentication ()
 
static getDocumentTemplate ()
 

Static Protected Attributes

static $tcaTableTypeConfigurationCache = []
 

Detailed Description

Standard functions available for the TYPO3 backend. You are encouraged to use this class in your own applications (Backend Modules) Don't instantiate - call functions with "\TYPO3\CMS\Backend\Utility\BackendUtility::" prefixed the function name.

Call ALL methods without making an object! Eg. to get a page-record 51 do this: '::getRecord('pages',51)'

Definition at line 55 of file backend/Classes/Utility/BackendUtility.php.

Member Function Documentation

static BEenableFields (   $table,
  $inv = false 
)
static

Backend implementation of enableFields() Notice that "fe_groups" is not selected for - only disabled, starttime and endtime. Notice that deleted-fields are NOT filtered - you must ALSO call deleteClause in addition. $GLOBALS["SIM_ACCESS_TIME"] is used for date.

Parameters
string$tableThe table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $GLOBALS['TCA'].
bool$invMeans that the query will select all records NOT VISIBLE records (inverted selection)
Returns
string WHERE clause part

Definition at line 346 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

Referenced by Typo3DbQueryParser\getBackendConstraintStatement(), StagesService\getBackendUsers(), and DataHandlerHook\getEmailsForStageChangeNotification().

static BEgetRootLine (   $uid,
  $clause = '',
  $workspaceOL = false 
)
static

Returns what is called the 'RootLine'. That is an array with information about the page records from a page id ($uid) and back to the root. By default deleted pages are filtered. This RootLine will follow the tree all the way to the root. This is opposite to another kind of root line known from the frontend where the rootline stops when a root-template is found.

Parameters
int$uidPage id for which to create the root line.
string$clauseClause can be used to select other criteria. It would typically be where-clauses that stops the process if we meet a page, the user has no reading access to.
bool$workspaceOLIf TRUE, version overlay is applied. This must be requested specifically because it is usually only wanted when the rootline is used for visual output while for permission checking you want the raw thing!
Returns
array Root line array, all the way to the page tree root (or as far as $clause allows!)

Definition at line 440 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DatabasePageRootline\addData(), VersionModuleController\adminLinks(), ActionTask\checkRootline(), TreelistCacheUpdateHooks\clearCacheForAllParents(), ConditionMatcher\determineRootline(), ExtendedTemplateService\ext_prevPageWithTemplate(), EditDocumentController\generatePreviewCode(), InternalLinktype\getBrokenUrl(), InfoModuleController\getButtons(), PageFunctionsController\getButtons(), DatabaseRecordList\getButtons(), VersionModuleController\getButtons(), ImportExportController\getButtons(), TypoScriptTemplateModuleController\getButtons(), NewRecordController\getButtons(), DatabaseRecordList\getDocHeaderButtons(), ViewModuleController\getDomainName(), ExtdirectTreeCommands\getNodePaths(), InfoPageTyposcriptConfigController\getOverviewOfPagesUsingTSConfig(), ElementInformationController\getRecordActions(), BackendLayoutView\getRootLine(), PermissionController\initializeView(), BackendUserAuthentication\isInWebMount(), TypoScriptTemplateModuleController\main(), PageLayoutController\main(), PageLayoutController\makeButtons(), and DocumentTemplate\viewPageIcon().

static blindGroupNames (   $groups,
  $groupArray,
  $excludeBlindedFlag = false 
)
static

Corresponds to blindUserNames but works for groups instead

Parameters
array$groupsGroup names
array$groupArrayGroup names (reference)
bool$excludeBlindedFlagIf $excludeBlindedFlag is set, then these records are unset from the array $usernames
Returns
array

Definition at line 1404 of file backend/Classes/Utility/BackendUtility.php.

References ArrayUtility\inArray().

static blindUserNames (   $usernames,
  $groupArray,
  $excludeBlindedFlag = false 
)
static

Returns the array $usernames with the names of all users NOT IN $groupArray changed to the uid (hides the usernames!). If $excludeBlindedFlag is set, then these records are unset from the array $usernames Takes $usernames (array made by ::getUserNames()) and a $groupArray (array with the groups a certain user is member of) as input

Parameters
array$usernamesUser names
array$groupArrayGroup names
bool$excludeBlindedFlagIf $excludeBlindedFlag is set, then these records are unset from the array $usernames
Returns
array User names, blinded

Definition at line 1370 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\inList().

static buildScriptUrl (   $mainParams,
  $addParams,
  $script = '' 
)
staticprotected

Builds the URL to the current script with given arguments

Parameters
mixed$mainParams$id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string$addParamsAdditional parameters to pass to the script.
string$scriptThe script to send the &id to, if empty it's automatically found
Returns
string The completes script URL

Definition at line 3410 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\_GET(), GeneralUtility\_GP(), GeneralUtility\implodeArrayForUrl(), and GeneralUtility\makeInstance().

static calcAge (   $seconds,
  $labels = ' min| hrs| days| yrs| min| hour| day| year' 
)
static

Returns the "age" in minutes / hours / days / years of the number of $seconds inputted.

Parameters
int$secondsSeconds could be the difference of a certain timestamp and time()
string$labelsLabels should be something like ' min| hrs| days| yrs| min| hour| day| year'. This value is typically delivered by this function call: $GLOBALS["LANG"]->sL("LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears")
Returns
string Formatted time

Definition at line 1492 of file backend/Classes/Utility/BackendUtility.php.

Referenced by BackendUtilityTest\calcAgeReturnsExpectedValues(), RecordHistory\displayHistory(), NoneElement\formatValue(), RteController\getButtons(), EditDocumentController\getButtons(), TcaRecordTitle\getRecordTitleForInputType(), and PageLayoutController\makeButtons().

static createPreviewUrl (   $pageUid,
  $rootLine,
  $anchorSection,
  $additionalGetVars,
  $viewScript 
)
staticprotected

Creates the view-on-click preview URL without any alternative URL.

Parameters
int$pageUidPage UID
array$rootLineIf rootline is supplied, the function will look for the first found domain record and use that URL instead
string$anchorSectionOptional anchor to the URL
string$additionalGetVarsAdditional GET variables.
string$viewScriptThe path to the script used to view the page
Returns
string The preview URL

Definition at line 3124 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\intExplode(), and GeneralUtility\makeInstance().

static cshItem (   $table,
  $field,
  $_ = '',
  $wrap = '' 
)
static

API for getting CSH icons/text for use in backend modules. TCA_DESCR will be loaded if it isn't already

Parameters
string$tableTable name ('MOD'+module name)
string$fieldField name (CSH locallang main key)
string$_(unused)
string$wrapWrap code for icon-mode, splitted by "|". Not used for full-text mode.
Returns
string HTML content for help text

Definition at line 2925 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DatabaseRecordList\getButtons(), NewRecordController\getButtons(), LinkValidatorReport\getDocHeaderButtons(), PageLayoutView\getTable_pages(), PageInformationController\main(), TranslationStatusController\main(), InfoPageTyposcriptConfigController\main(), CreateFolderController\main(), HelpButton\render(), and CshViewHelper\renderStatic().

static date (   $tstamp)
static

Returns $tstamp formatted as "ddmmyy" (According to $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'])

Parameters
int$tstampTime stamp, seconds
Returns
string Formatted time

Definition at line 1446 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

Referenced by BackendUtility\datetime(), FileController\flattenResultDataValue(), FileList\formatDirList(), FileList\formatFileList(), FileFacade\getLastModified(), and TcaRecordTitle\getRecordTitleForInputType().

static datetime (   $value)
static

Returns $tstamp formatted as "ddmmyy hhmm" (According to $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] AND $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'])

Parameters
int$valueTime stamp, seconds
Returns
string Formatted time

Definition at line 1457 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, and BackendUtility\date().

Referenced by RecordHistory\displayHistory(), ListSysLogCommand\execute(), TcaRecordTitle\getRecordTitleForInputType(), ConfigurationStatus\getReferenceIndexStatus(), DateTimeViewHelper\renderStatic(), and DeletedRecordsController\transform().

static dateTimeAge (   $tstamp,
  $prefix = 1,
  $date = '' 
)
static

Returns a formatted timestamp if $tstamp is set. The date/datetime will be followed by the age in parenthesis.

Parameters
int$tstampTime stamp, seconds
int$prefix1/-1 depending on polarity of age.
string$date$date=="date" will yield "dd:mm:yy" formatting, otherwise "dd:mm:yy hh:mm
Returns
string

Definition at line 1522 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

Referenced by ActionTask\viewEditRecord().

static daysUntil (   $tstamp)
static

Returns the difference in days between input $tstamp and $EXEC_TIME

Parameters
int$tstampTime stamp, seconds
Returns
int

Definition at line 1434 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

static deleteClause (   $table,
  $tableAlias = '' 
)
static

Returns the WHERE clause " AND NOT [tablename].[deleted-field]" if a deleted-field is configured in $GLOBALS['TCA'] for the tablename, $table This function should ALWAYS be called in the backend for selection on tables which are configured in $GLOBALS['TCA'] since it will ensure consistent selection of records, even if they are marked deleted (in which case the system must always treat them as non-existent!) In the frontend a function, ->enableFields(), is known to filter hidden-field, start- and endtime and fe_groups as well. But that is a job of the frontend, not the backend. If you need filtering on those fields as well in the backend you can use ->BEenableFields() though.

Parameters
string$tableTable name present in $GLOBALS['TCA']
string$tableAliasTable alias if any
Returns
string WHERE clause for filtering out deleted records, eg " AND tablename.deleted=0

Definition at line 84 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, and GeneralUtility\makeInstance().

Referenced by Typo3DbQueryParser\getBackendConstraintStatement(), LocalizationRepository\getExcludeQueryPart(), and AbstractDatabaseRecordList\makeQueryArray().

static editOnClick (   $params,
  $_ = '',
  $requestUri = '' 
)
static

Returns a JavaScript string (for an onClick handler) which will load the EditDocumentController script that shows the form for editing of the record(s) you have send as params. REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)

Parameters
string$paramsParameters sent along to EditDocumentController. This requires a much more details description which you must seek in Inside TYPO3s documentation of the FormEngine API. And example could be '&edit[pages][123] = edit' which will show edit form for page record 123.
string$_(unused)
string$requestUriAn optional returnUrl you can set - automatically set to REQUEST_URI.
Returns
string

Definition at line 2952 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\getIndpEnv(), and GeneralUtility\quoteJSvalue().

Referenced by DatabaseRecordList\getButtons(), DatabaseRecordList\getDocHeaderButtons(), AbstractDatabaseRecordList\linkWrapItems(), DatabaseRecordList\makeControl(), PageLayoutView\newContentElementOnClick(), PagePositionMap\onClickEvent(), TranslationStatusController\renderL10nTable(), DatabaseRecordList\renderListHeader(), and PageLayoutView\tt_content_drawColHeader().

static emitGetPagesTSconfigPreIncludeSignal ( array  $TSdataArray,
  $id,
array  $rootLine,
  $returnPartArray 
)
staticprotected

Emits signal to modify the page TSconfig before include

Parameters
array$TSdataArrayCurrent TSconfig data array - Can be modified by slots!
int$idPage ID we are handling
array$rootLineRootline array of page
bool$returnPartArrayWhether TSdata should be parsed by TS parser or returned as plain text
Returns
array Modified Data array

Definition at line 4984 of file backend/Classes/Utility/BackendUtility.php.

static explodeSoftRefParserList (   $parserList)
static

Returns array of soft parser references

Parameters
string$parserListsoftRef parser list
Returns
array|bool Array where the parser key is the key and the value is the parameter string, FALSE if no parsers were found
Exceptions
InvalidArgumentException

Definition at line 4127 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\trimExplode().

Referenced by ReferenceIndex\getRelations(), and ReferenceIndex\getRelations_flexFormCallBack().

static firstDomainRecord (   $rootLine)
static

Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine

Parameters
array$rootLineRoot line array
Returns
string|NULL Domain name or NULL

Definition at line 3972 of file backend/Classes/Utility/BackendUtility.php.

Referenced by InternalLinktype\getBrokenUrl(), and ViewModuleController\getDomainName().

static fixVersioningPid (   $table,
$rr,
  $ignoreWorkspaceMatch = false 
)
static

Find page-tree PID for versionized record Will look if the "pid" value of the input record is -1 and if the table supports versioning - if so, it will translate the -1 PID into the PID of the original record Used whenever you are tracking something back, like making the root line. Will only translate if the workspace of the input record matches that of the current user (unless flag set) Principle; Record offline! => Find online?

If the record had its pid corrected to the online versions pid, then "_ORIG_pid" is set to the original pid value (-1 of course). The field "_ORIG_pid" is used by various other functions to detect if a record was in fact in a versionized branch.

Parameters
string$tableTable name
array$rrRecord array passed by reference. As minimum, "pid" and "uid" fields must exist! "t3ver_oid" and "t3ver_wsid" is nice and will save you a DB query.
bool$ignoreWorkspaceMatchIgnore workspace match
Returns
void
See also
PageRepository::fixVersioningPid()

Definition at line 4390 of file backend/Classes/Utility/BackendUtility.php.

References Enumeration\cast(), ExtensionManagementUtility\isLoaded(), and VersionState\MOVE_POINTER.

Referenced by DatabaseEditRow\addData(), RecyclerUtility\checkAccess(), AbstractWizardController\checkEditAccess(), DataHandler\destNotInsideSelf(), DataHandler\doesRecordExist(), DataHandler\fillInFieldArray(), FlexFormTools\getDataStructureIdentifierFromRecord(), RecyclerUtility\getRecordPath(), DataHandler\getRecordPropertiesFromRow(), RichTextElement\render(), and RichTextNodeResolver\resolve().

static getBackendScript (   $interface = '')
static

Returns the name of the backend script relative to the TYPO3 main directory.

Parameters
string$interfaceName of the backend interface (backend, frontend) to look up the script name for. If no interface is given, the interface for the current backend user is used.
Returns
string The name of the backend script relative to the TYPO3 main directory.

Definition at line 4865 of file backend/Classes/Utility/BackendUtility.php.

Referenced by AdminPanelView\getEditModule().

static getBackendUserAuthentication ( )
staticprotected
Returns
BackendUserAuthentication

Definition at line 5027 of file backend/Classes/Utility/BackendUtility.php.

static getCommonSelectFields (   $table,
  $prefix = '',
  $fields = [] 
)
static

Returns fields for a table, $table, which would typically be interesting to select This includes uid, the fields defined for title, icon-field. Returned as a list ready for query ($prefix can be set to eg. "pages." if you are selecting from the pages table and want the table name prefixed)

Parameters
string$tableTable name, present in $GLOBALS['TCA']
string$prefixTable prefix
array$fieldsPreset fields (must include prefix if that is used)
Returns
string List of fields.

Definition at line 2681 of file backend/Classes/Utility/BackendUtility.php.

References $fields, and GeneralUtility\trimExplode().

Referenced by AbstractItemProvider\buildForeignTableQueryBuilder(), DatabaseIntegrityCheck\genTree_records(), and BackendUtilityTest\getCommonSelectFieldsReturnsCorrectFields().

static getConnectionForTable (   $table)
staticprotected
Parameters
string$table
Returns
Connection

Definition at line 5002 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

static getDocumentTemplate ( )
staticprotected
Returns
DocumentTemplate

Definition at line 5035 of file backend/Classes/Utility/BackendUtility.php.

static getDomainStartPage (   $domain,
  $path = '' 
)
static

Returns the sys_domain record for $domain, optionally with $path appended.

Parameters
string$domainDomain name
string$pathAppended path
Returns
array|bool Domain record, if found, false otherwise

Definition at line 4012 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

static getDropdownMenu (   $mainParams,
  $elementName,
  $currentValue,
  $menuItems,
  $script = '',
  $addParams = '' 
)
static

Returns a selector box to switch the view Requires the JS function jumpToUrl() to be available Based on BackendUtility::getFuncMenu() but done as new function because it has another purpose. Mingling with getFuncMenu would harm the docHeader Menu.

Parameters
mixed$mainParamsThe "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string$elementNameThe form elements name, probably something like "SET[...]
string$currentValueThe value to be selected currently.
array$menuItemsAn array with the menu items for the selector box
string$scriptThe script to send the &id to, if empty it's automatically found
string$addParamsAdditional parameters to pass to the script.
Returns
string HTML code for selector box

Definition at line 3307 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\quoteJSvalue().

Referenced by DatabaseIntegrityView\func_search(), PageInformationController\main(), TranslationStatusController\main(), InfoPageTyposcriptConfigController\main(), TypoScriptTemplateConstantEditorModuleFunctionController\main(), and TypoScriptTemplateObjectBrowserModuleFunctionController\main().

static getFlexFormDS (   $conf,
  $row,
  $table,
  $fieldName = '',
  $WSOL = true,
  $newRecordPidValue = 0 
)
static

Finds the Data Structure for a FlexForm field

NOTE ON data structures for deleted records: This function may fail to deliver the data structure for a record for a few reasons: a) The data structure could be deleted (either with deleted-flagged or hard-deleted), b) the data structure is fetched using the ds_pointerField_searchParent in which case any deleted record on the route to the final location of the DS will make it fail. In theory, we can solve the problem in the case where records that are deleted-flagged keeps us from finding the DS - this is done at the markers ###NOTE_A### where we make sure to also select deleted records. However, we generally want the DS lookup to fail for deleted records since for the working website we expect a deleted-flagged record to be as inaccessible as one that is completely deleted from the DB. Any way we look at it, this may lead to integrity problems of the reference index and even lost files if attached. However, that is not really important considering that a single change to a data structure can instantly invalidate large amounts of the reference index which we do accept as a cost for the flexform features. Other than requiring a reference index update, deletion of/changes in data structure or the failure to look them up when completely deleting records may lead to lost files in the uploads/ folders since those are now without a proper reference.

Parameters
array$confField config array
array$rowRecord data
string$tableThe table name
string$fieldNameOptional fieldname passed to hook object
bool$WSOLIf set, workspace overlay is applied to records. This is correct behaviour for all presentation and export, but NOT if you want a TRUE reflection of how things are in the live workspace.
int$newRecordPidValueSPECIAL CASES: Use this, if the DataStructure may come from a parent record and the INPUT row doesn't have a uid yet (hence, the pid cannot be looked up). Then it is necessary to supply a PID value to search recursively in for the DS (used from DataHandler)
Returns
mixed If array, the data structure was found and returned as an array. Otherwise (string) it is an error message.
Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9. This is now integrated as FlexFormTools->getDataStructureIdentifier()

Definition at line 959 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, MathUtility\canBeInterpretedAsInteger(), GeneralUtility\getFileAbsFileName(), GeneralUtility\getUserObj(), GeneralUtility\logDeprecatedFunction(), GeneralUtility\makeInstance(), GeneralUtility\trimExplode(), and GeneralUtility\xml2array().

static getFuncCheck (   $mainParams,
  $elementName,
  $currentValue,
  $script = '',
  $addParams = '',
  $tagParams = '' 
)
static

Checkbox function menu. Works like ->getFuncMenu() but takes no $menuItem array since this is a simple checkbox.

Parameters
mixed$mainParams$id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string$elementNameThe form elements name, probably something like "SET[...]
string$currentValueThe value to be selected currently.
string$scriptThe script to send the &id to, if empty it's automatically found
string$addParamsAdditional parameters to pass to the script.
string$tagParamsAdditional attributes for the checkbox input tag
Returns
string HTML code for checkbox
See also
getFuncMenu()

Definition at line 3353 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\quoteJSvalue().

Referenced by DatabaseIntegrityView\func_search(), FileBrowser\getBulkSelector(), AddImageHandler\getBulkSelector(), BackendUtilityTest\getFuncCheckReturnsInputTagWithValueAttribute(), InfoPageTyposcriptConfigController\main(), TemplateAnalyzerModuleFunctionController\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), TypoScriptTemplateInformationModuleFunctionController\main(), and QueryGenerator\makeSelectorTable().

static getFuncInput (   $mainParams,
  $elementName,
  $currentValue,
  $size = 10,
  $script = '',
  $addParams = '' 
)
static

Input field function menu Works like ->getFuncMenu() / ->getFuncCheck() but displays an input field instead which updates the script "onchange"

Parameters
mixed$mainParams$id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string$elementNameThe form elements name, probably something like "SET[...]
string$currentValueThe value to be selected currently.
int$sizeRelative size of input field, max is 48
string$scriptThe script to send the &id to, if empty it's automatically found
string$addParamsAdditional parameters to pass to the script.
Returns
string HTML code for input text field.
See also
getFuncMenu()

Definition at line 3389 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\quoteJSvalue().

static getFuncMenu (   $mainParams,
  $elementName,
  $currentValue,
  $menuItems,
  $script = '',
  $addParams = '' 
)
static

Returns a selector box "function menu" for a module Requires the JS function jumpToUrl() to be available See Inside TYPO3 for details about how to use / make Function menus

Parameters
mixed$mainParamsThe "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string$elementNameThe form elements name, probably something like "SET[...]
string$currentValueThe value to be selected currently.
array$menuItemsAn array with the menu items for the selector box
string$scriptThe script to send the &id to, if empty it's automatically found
string$addParamsAdditional parameters to pass to the script.
Returns
string HTML code for selector box

Definition at line 3260 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\quoteJSvalue().

Referenced by VersionModuleController\main(), and TypoScriptTemplateModuleController\templateMenu().

static getGroupNames (   $fields = 'title,
uid'  ,
  $where = '' 
)
static

Returns an array with be_groups records (title, uid) of all groups NOT DELETED sorted by their title

Parameters
string$fieldsField list
string$whereWHERE clause
Returns
array

Definition at line 1289 of file backend/Classes/Utility/BackendUtility.php.

References $fields, and GeneralUtility\trimExplode().

Referenced by AbstractController\createUserAndGroupListForSelectOptions(), and PermissionAjaxController\renderGroupSelector().

static getInlineLocalizationMode (   $table,
  $fieldOrConfig 
)
static

Returns the value of the property localizationMode in the given $config array ($GLOBALS['TCA'][

['columns'][<field>]['config']). If the table is prepared for localization and no localizationMode is set, 'select' is returned by default. If the table is not prepared for localization or not defined at all in $GLOBALS['TCA'], FALSE is returned.

Parameters
string$tableThe name of the table to lookup in TCA
mixed$fieldOrConfigThe fieldname (string) or the configuration of the field to check (array)
Returns
mixed If table is localizable, the set localizationMode is returned (if property is not set, 'select' is returned by default); if table is not localizable, FALSE is returned

Definition at line 665 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

Referenced by DataHandler\copyRecord_procBasedOnFieldType(), InlineStackProcessor\initializeByParsingDomObjectIdString(), and InlineStackProcessor\injectAjaxConfiguration().

static getItemLabel (   $table,
  $col 
)
static

Returns the label-value for fieldname $col in table, $table If $printAllWrap is set (to a "wrap") then it's wrapped around the $col value IF THE COLUMN $col DID NOT EXIST in TCA!, eg. $printAllWrap = '|' and the fieldname was 'not_found_field' then the return value would be 'not_found_field'

Parameters
string$tableTable name, present in $GLOBALS['TCA']
string$colField name
Returns
string or NULL if $col is not found in the TCA table

Definition at line 2063 of file backend/Classes/Utility/BackendUtility.php.

Referenced by RecordHistory\displayHistory(), HistoryService\getDifferences(), PageLayoutView\getTable_pages(), RecordHistory\renderDiff(), and DatabaseRecordList\renderListHeader().

static getLabelFromItemlist (   $table,
  $col,
  $key 
)
static

Returns the label of the first found entry in an "items" array from $GLOBALS'TCA' where the value is $key

Parameters
string$tableTable name, present in $GLOBALS['TCA']
string$colField name, present in $GLOBALS['TCA']
string$keyitems-array value to match
Returns
string Label for item entry

Definition at line 1950 of file backend/Classes/Utility/BackendUtility.php.

Referenced by PageLayoutController\getHeaderFlashMessagesForCurrentPid(), BackendUtilityTest\getLabelFromItemlistReturnsCorrectFields(), PageLayoutController\makeQuickEditMenu(), and PagePositionMap\printRecordMap().

static getLabelFromItemListMerged (   $pageId,
  $table,
  $column,
  $key 
)
static

Return the label of a field by additionally checking TsConfig values

Parameters
int$pageIdPage id
string$tableTable name
string$columnField Name
string$keyitem value
Returns
string Label for item entry

Definition at line 1977 of file backend/Classes/Utility/BackendUtility.php.

Referenced by BackendUtilityTest\getLabelFromItemListMergedReturnsCorrectFields().

static getLabelsFromItemsList (   $table,
  $column,
  $keyList,
array  $columnTsConfig = [] 
)
static

Splits the given key with commas and returns the list of all the localized items labels, separated by a comma. NOTE: this does not take itemsProcFunc into account

Parameters
string$tableTable name, present in TCA
string$columnField name
string$keyListKey or comma-separated list of keys.
array$columnTsConfigpage TSConfig for $column (TCEMAIN.
<column>)
Returns
string Comma-separated list of localized labels

Definition at line 2014 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\trimExplode().

Referenced by BackendUtilityTest\getLabelsFromItemsListReturnsCorrectValue().

static getLanguageService ( )
staticprotected
Returns
LanguageService

Definition at line 5019 of file backend/Classes/Utility/BackendUtility.php.

static getLinkToDataHandlerAction (   $parameters,
  $redirectUrl = '' 
)
static

Returns a URL with a command to TYPO3 Datahandler

Parameters
string$parametersSet of GET params to send. Example: "&cmd[tt_content][123][move]=456" or "&data[tt_content][123][hidden]=1&data[tt_content][123][title]=Hello%20World
string | int$redirectUrlRedirect URL, default is to use GeneralUtility::getIndpEnv('REQUEST_URI'), -1 means to generate an URL for JavaScript using T3_THIS_LOCATION
Returns
string URL to BackendUtility::getModuleUrl('tce_db') + parameters

Definition at line 3097 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\getIndpEnv(), and GeneralUtility\quoteJSvalue().

Referenced by VersionModuleController\adminLinks(), FileList\formatFileList(), EditDocumentController\languageSwitch(), DatabaseRecordList\makeControl(), DatabaseRecordList\makeLocalizationPanel(), PageLayoutView\tt_content_drawHeader(), and VersionModuleController\versioningMgm().

static getListGroupNames (   $fields = 'title,
uid'   
)
static

Returns an array with be_groups records (like ->getGroupNames) but:

  • if the current BE_USER is admin, then all groups are returned, otherwise only groups that the current user is member of (usergroup_cached_list) will be returned.
Parameters
string$fieldsField list; $fields specify the fields selected (default: title,uid)
Returns
array

Definition at line 1350 of file backend/Classes/Utility/BackendUtility.php.

References $fields.

Referenced by PermissionController\editAction().

static getLiveVersionIdOfRecord (   $table,
  $uid 
)
static

Gets the id of the live version of a record.

Parameters
string$tableName of the table
int$uidUid of the offline/draft record
Returns
int The id of the live version of the record (or NULL if nothing was found)

Definition at line 4625 of file backend/Classes/Utility/BackendUtility.php.

Referenced by TcaInline\addInlineFirstPid(), TcaInline\getLiveDefaultId(), RelationHandler\getLiveDefaultId(), DataHandler\remapListedDBRecords_procDBRefs(), and WorkspaceService\viewSingleRecord().

static getLiveVersionOfRecord (   $table,
  $uid,
  $fields = '*' 
)
static

Returns live version of record

Parameters
string$tableTable name
int$uidRecord UID of draft, offline version
string$fieldsField list, default is *
Returns
array|NULL If found, the record, otherwise NULL

Definition at line 4609 of file backend/Classes/Utility/BackendUtility.php.

References $fields.

Referenced by DataHandler\getSortNumber(), AddController\init(), EditDocumentController\languageSwitch(), DataHandler\moveRecord(), DataHandler\placeholderShadowing(), DataHandlerHook\processCmdmap_deleteAction(), DataHandler\resolvePid(), DataHandlerHook\version_clearWSID(), and WorkspaceService\viewSingleRecord().

static getModTSconfig (   $id,
  $TSref 
)
static
static getModuleData (   $MOD_MENU,
  $CHANGED_SETTINGS,
  $modName,
  $type = '',
  $dontValidateList = '',
  $setDefaultList = '' 
)
static

Returns an array which is most backend modules becomes MOD_SETTINGS containing values from function menus etc. determining the function of the module. This is kind of session variable management framework for the backend users. If a key from MOD_MENU is set in the CHANGED_SETTINGS array (eg. a value is passed to the script from the outside), this value is put into the settings-array Ultimately, see Inside TYPO3 for how to use this function in relation to your modules.

Parameters
array$MOD_MENUMOD_MENU is an array that defines the options in menus.
array$CHANGED_SETTINGSCHANGED_SETTINGS represents the array used when passing values to the script from the menus.
string$modNamemodName is the name of this module. Used to get the correct module data.
string$typeIf type is 'ses' then the data is stored as session-lasting data. This means that it'll be wiped out the next time the user logs in.
string$dontValidateListdontValidateList can be used to list variables that should not be checked if their value is found in the MOD_MENU array. Used for dynamically generated menus.
string$setDefaultListList of default values from $MOD_MENU to set in the output array (only if the values from MOD_MENU are not arrays)
Returns
array The array $settings, which holds a key for each MOD_MENU key and the values of each key will be within the range of values for each menuitem

Definition at line 3559 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\inList().

Referenced by AbstractFunctionModule\checkExtObj(), BaseScriptClass\checkExtObj(), FileBrowser\getBulkSelector(), AddImageHandler\getBulkSelector(), AbstractFunctionModule\handleExternalFunctionValue(), TypoScriptTemplateConstantEditorModuleFunctionController\main(), DatabaseIntegrityView\menuConfig(), ConfigurationView\menuConfig(), VersionModuleController\menuConfig(), BaseScriptClass\menuConfig(), RecordList\menuConfig(), FileListController\menuConfig(), PageLayoutController\menuConfig(), QueryView\procesStoreControl(), TypoScriptTemplateInfoHook\save(), and TypoScriptTemplateModuleController\templateMenu().

static getMovePlaceholder (   $table,
  $uid,
  $fields = '*',
  $workspace = null 
)
static

Returns move placeholder of online (live) version

Parameters
string$tableTable name
int$uidRecord UID of online version
string$fieldsField list, default is *
int | NULL$workspaceThe workspace to be used
Returns
array|bool If found, the record, otherwise false

Definition at line 4701 of file backend/Classes/Utility/BackendUtility.php.

References $fields, GeneralUtility\makeInstance(), VersionState\MOVE_PLACEHOLDER, and GeneralUtility\trimExplode().

Referenced by DataHandler\deleteVersionsForRecord(), DataHandler\getSortNumber(), DataHandlerHook\moveRecord(), DataHandlerHook\moveRecord_wsPlaceholders(), DataHandlerHook\processCmdmap_deleteAction(), DataHandlerHook\version_clearWSID(), and WorkspaceService\viewSingleRecord().

static getNoRecordTitle (   $prep = false)
static

Get a localized [No title] string, wrapped in | if $prep is TRUE.

Parameters
bool$prepWrap result in |
Returns
string Localized [No title] string

Definition at line 2210 of file backend/Classes/Utility/BackendUtility.php.

static getOriginalTranslationTable (   $table)
static

Gets the original translation pointer table. That is now the same table, apart from pages_language_overlay where pages is the original.

Parameters
string$tableName of the table
Returns
string Pointer table (if any)

Definition at line 635 of file backend/Classes/Utility/BackendUtility.php.

static getPageForRootline (   $uid,
  $clause,
  $workspaceOL 
)
staticprotected

Gets the cached page record for the rootline

Parameters
int$uidPage id for which to create the root line.
string$clauseClause can be used to select other criteria. It would typically be where-clauses that stops the process if we meet a page, the user has no reading access to.
bool$workspaceOLIf TRUE, version overlay is applied. This must be requested specifically because it is usually only wanted when the rootline is used for visual output while for permission checking you want the raw thing!
Returns
array Cached page record for the rootline
See also
BEgetRootLine

Definition at line 499 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance(), and QueryHelper\stripLogicalOperatorPrefix().

static getPagesTSconfig (   $id,
  $rootLine = null,
  $returnPartArray = false 
)
static

Returns the Page TSconfig for page with id, $id

Parameters
int$idPage uid for which to create Page TSconfig
array$rootLineIf $rootLine is an array, that is used as rootline, otherwise rootline is just calculated
bool$returnPartArrayIf $returnPartArray is set, then the array with accumulated Page TSconfig is returned non-parsed. Otherwise the output will be parsed by the TypoScript parser.
Returns
array Page TSconfig
See also

Definition at line 1177 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, TypoScriptParser\checkIncludeLines_array(), ExtensionManagementUtility\extPath(), ExtensionManagementUtility\isLoaded(), GeneralUtility\makeInstance(), ArrayUtility\mergeRecursiveWithOverrule(), and GeneralUtility\trimExplode().

Referenced by BackendLayoutView\addBackendLayoutItems(), PageTsConfig\addData(), DataHandler\checkValue_flex_procInData_travDS(), Typo3DbBackend\clearPageCache(), DataHandler\fillInFieldArray(), PageTsBackendLayoutDataProvider\generatePageTsConfig(), EditDocumentController\generatePreviewCode(), NewRecordController\getButtons(), EditDocumentController\getButtons(), ViewModuleController\getDomainName(), AbstractLinkBrowserController\getLinkHandlers(), DataHandler\getTCEMAIN_TSconfig(), NewContentElementController\init(), SelectImageController\initVariables(), BrowseLinksController\initVariables(), InfoPageTyposcriptConfigController\main(), ParseHtmlController\main_parse_html(), UserElementsController\main_user(), NewRecordController\regularNew(), RichTextElement\render(), RichTextNodeResolver\resolve(), SuggestWizardController\searchAction(), and WorkspaceService\viewSingleRecord().

static getPidForModTSconfig (   $table,
  $uid,
  $pid 
)
static

Return $uid if $table is pages and $uid is int - otherwise the $pid

Parameters
string$tableTable name
int$uidRecord uid
int$pidRecord pid
Returns
int

Definition at line 3913 of file backend/Classes/Utility/BackendUtility.php.

References MathUtility\canBeInterpretedAsInteger().

static getProcessedValueExtra (   $table,
  $fN,
  $fV,
  $fixed_lgd_chars = 0,
  $uid = 0,
  $forceResult = true,
  $pid = 0 
)
static

Same as ->getProcessedValue() but will go easy on fields like "tstamp" and "pid" which are not configured in TCA - they will be formatted by this function instead.

Parameters
string$tableTable name, present in TCA
string$fNField name
string$fVField value
int$fixed_lgd_charsThe max amount of characters the value may occupy
int$uidUid of the current record
bool$forceResultIf BackendUtility::getRecordTitle is used to process the value, this parameter is forwarded.
int$pidOptional page uid is used to evaluate page TSConfig for the given field
Returns
string
See also
getProcessedValue()

Definition at line 2646 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DatabaseRecordList\renderListRow().

static getQueryBuilderForTable (   $table)
staticprotected
Parameters
string$table
Returns
QueryBuilder

Definition at line 5011 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

static getRecord (   $table,
  $uid,
  $fields = '*',
  $where = '',
  $useDeleteClause = true 
)
static

Gets record with uid = $uid from $table You can set $field to a list of fields (default is '*') Additional WHERE clauses can be added by $where (fx. ' AND blabla = 1') Will automatically check if records has been deleted and if so, not return anything. $table must be found in $GLOBALS['TCA']

Parameters
string$tableTable name present in $GLOBALS['TCA']
int$uidUID of record
string$fieldsList of fields to select
string$whereAdditional WHERE clause, eg. " AND blablabla = 0
bool$useDeleteClauseUse the deleteClause to check if a record is deleted (default TRUE)
Returns
array|NULL Returns the row if found, otherwise NULL

Definition at line 112 of file backend/Classes/Utility/BackendUtility.php.

References $fields, $GLOBALS, GeneralUtility\makeInstance(), QueryHelper\stripLogicalOperatorPrefix(), and GeneralUtility\trimExplode().

Referenced by TcaInline\addInlineFirstPid(), CommandMap\applyWorkspacesSetStageBehaviour(), ValidatorTask\buildMail(), WorkspaceService\canCreatePreviewLink(), RecyclerUtility\checkAccess(), CheckValueTestForCheckboxes\checkBoxValueMustBeDefinedInTcaItems(), CheckValueTestForCheckboxes\checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems(), AbstractWizardController\checkEditAccess(), IntegrityService\checkLocalization(), FileMetadataPermissionsAspect\checkModifyAccessList(), PagePositionMap\checkNewPageInPid(), FileMetadataPermissionsAspect\checkRecordUpdateAccess(), ExportTest\compileExportGroupFileAndFileReferenceItem(), ExportTest\compileExportPagesAndRelatedTtContentWithImages(), CrawlerHook\crawler_execute_type4(), ElementEntityProcessor\createClearDependentElementChildReferenceCallback(), ElementEntityProcessor\createClearDependentElementParentReferenceCallback(), ShortcutToolbarItem\createShortcutAction(), DataHandler\deleteAction(), DataHandler\deleteRecord_procFields(), ActionHandler\deleteSingleRecord(), Export\export_addDBRelations(), ExportTest\exportGroupFileAndFileReferenceItem(), ExportTest\exportIrreRecords(), ExportTest\exportPagesAndRelatedTtContent(), ExportTest\exportPagesAndRelatedTtContentWithRteImagesAndFileLink(), LiveSearch\findPageById(), DataHandlerHook\findPageElementsForVersionSwap(), DataHandlerHook\findPageIdsForVersionStateChange(), DataHandlerHook\findRealPageIds(), ActionTask\fixDbMount(), PageLayoutView\generateListForCTypeMenu(), EditDocumentController\generatePreviewCode(), ValidatorTask\getAdditionalInformation(), WorkspaceService\getCmdArrayForPublishWS(), LinkBrowserController\getCurrentPageId(), DatabaseRecordTypeValue\getDatabaseRow(), LiveSearch\getEditLink(), DataHandlerHook\getEmailsForStageChangeNotification(), PageLayoutController\getHeaderFlashMessagesForCurrentPid(), AbstractTreeView\getIcon(), UserFileInlineLabelService\getInlineLabel(), WorkspaceService\getLivePageUid(), ConditionMatcher\getPage(), LocalizationRepository\getPreviousLocalizedRecordUid(), DataHandler\getPreviousLocalizedRecordUid(), StagesService\getPropertyOfCurrentWorkspaceStage(), ActionHandler\getRecipientList(), FormManagerController\getRecord(), RecordHistory\getRecord(), EditDocumentController\getRecordForEdit(), StagesService\getStageRecord(), TranslationConfigurationProvider\getSystemLanguages(), ActionTask\getTask(), ActionTask\getUsergroups(), WorkspaceService\getWorkspaceTitle(), AddController\init(), NewRecordController\init(), ShortcutToolbarItem\initShortcuts(), CheckValueTest\insertRecordWithRadioFieldValue(), FileMetadataPermissionsAspect\isAllowedToShowEditForm(), ActionTask\isCreatedByUser(), BackendUserAuthentication\isInWebMount(), WorkspaceService\isNewPage(), ConditionMatcher\isNewPageWithPageId(), WorkspaceService\isPageAccessibleForCurrentUser(), DataHandler\isRecordUndeletable(), EditDocumentController\languageSwitch(), AbstractDatabaseRecordList\linkWrapItems(), DatabaseRecord\loadRow(), ListController\main(), MoveElementController\main(), LinkValidatorReport\main(), VersionModuleController\main(), DatabaseRecordList\makeClip(), DatabaseRecordList\makeControl(), DatabaseRecordList\makeLocalizationPanel(), DataHandlerHook\moveRecord_wsPlaceholders(), DataHandler\placeholderShadowing(), ClickMenu\printDBClickMenu(), ClickMenu\printFileClickMenu(), ClickMenu\printNewDBLevel(), TreelistCacheUpdateHooks\processCmdmap_postProcess(), TreelistCacheUpdateHooks\processDatamap_afterDatabaseOperations(), CrawlerHook\processDatamap_afterDatabaseOperations(), Import\processSoftReferences_substTokens(), QueryView\procesStoreControl(), BackendUserAuthentication\recordEditAccessInternals(), RenderContentElementPreviewViewHelper\renderStatic(), AdministrationRepository\saveKeywords(), ActionTask\saveNewBackendUser(), ActionHandler\sendToNextStageExecute(), ActionHandler\sendToNextStageWindow(), ActionHandler\sendToPrevStageExecute(), ActionHandler\sendToPrevStageWindow(), ActionHandler\sendToSpecificStageExecute(), ActionHandlerTest\sendToSpecificStageExecuteIgnoresDoublePublishes(), Import\setFlexFormRelations(), ElementHistoryController\setPagePath(), AdministrationController\statisticDetailsAction(), ActionHandler\swapSingleRecord(), BackendUserController\switchUser(), AjaxController\switchWorkspaceAction(), TableController\tableWizard(), DeletedRecordsController\transform(), RteHtmlParser\TS_links_rte(), ValidatorTaskAdditionalFieldProvider\validateAdditionalFields(), DataHandlerHook\version_clearWSID(), DataHandlerHook\version_setStage(), VersionModuleController\versioningMgm(), ActionTask\viewEditRecord(), ActionTask\viewNewBackendUser(), WorkspaceService\viewSingleRecord(), BackendUserAuthentication\workspaceCannotEditOfflineVersion(), BackendUserAuthentication\workspaceCannotEditRecord(), BackendUserAuthentication\workspaceCheckStageForCurrent(), and RelationHandler\writeForeignField().

static getRecordIconAltText (   $row,
  $table = 'pages' 
)
static

Returns title-attribute information for ANY record (from a table defined in TCA of course) The included information depends on features of the table, but if hidden, starttime, endtime and fe_group fields are configured for, information about the record status in regard to these features are is included. "pages" table can be used as well and will return the result of ->titleAttribForPages() for that page.

Parameters
array$rowTable row; $row is a row from the table, $table
string$tableTable name
Returns
string

Definition at line 1891 of file backend/Classes/Utility/BackendUtility.php.

References Enumeration\cast(), VersionState\DELETE_PLACEHOLDER, VersionState\MOVE_PLACEHOLDER, VersionState\MOVE_POINTER, VersionState\NEW_PLACEHOLDER, and VersionState\NEW_PLACEHOLDER_VERSION.

Referenced by DocumentTemplate\getPageInfo(), PagePositionMap\getRecordHeader(), and InlineRecordContainer\renderForeignRecordHeader().

static getRecordLocalization (   $table,
  $uid,
  $language,
  $andWhereClause = '' 
)
static

Fetches the localization for a given record.

Parameters
string$tableTable name present in $GLOBALS['TCA']
int$uidThe uid of the record
int$languageThe uid of the language record in sys_language
string$andWhereClauseOptional additional WHERE clause (default: '')
Returns
mixed Multidimensional array with selected records; if none exist, FALSE is returned

Definition at line 383 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, GeneralUtility\makeInstance(), and QueryHelper\stripLogicalOperatorPrefix().

Referenced by DataHandler\getPreviousLocalizedRecordUid().

static getRecordPath (   $uid,
  $clause,
  $titleLimit,
  $fullTitleLimit = 0 
)
static

Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage" Each part of the path will be limited to $titleLimit characters Deleted pages are filtered out.

Parameters
int$uidPage uid for which to create record path
string$clauseClause is additional where clauses, eg.
int$titleLimitTitle limit
int$fullTitleLimitTitle limit of Full title (typ. set to 1000 or so)
Returns
mixed Path of record (string) OR array with short/long title if $fullTitleLimit is set.

Definition at line 600 of file backend/Classes/Utility/BackendUtility.php.

Referenced by PageLayoutController\getHeaderFlashMessagesForCurrentPid(), SuggestWizardDefaultReceiver\getRecordPath(), DatabaseRecordList\recPath(), OuterWrapContainer\render(), PagePathViewHelper\renderStatic(), LinkValidatorReport\renderTableRow(), and ActionTask\viewEditRecord().

static getRecordRaw (   $table,
  $where = '',
  $fields = '*' 
)
static

Returns the first record found from $table with $where as WHERE clause This function does NOT check if a record has the deleted flag set. $table does NOT need to be configured in $GLOBALS['TCA'] The query used is simply this: $query = 'SELECT ' . $fields . ' FROM ' . $table . ' WHERE ' . $where;

Parameters
string$tableTable name (not necessarily in TCA)
string$whereWHERE clause
string$fields$fields is a list of fields to select, default is '*'
Returns
array|bool First row found, if any, FALSE otherwise

Definition at line 194 of file backend/Classes/Utility/BackendUtility.php.

References $fields, QueryHelper\stripLogicalOperatorPrefix(), and GeneralUtility\trimExplode().

Referenced by CleanFlexFormsCommand\compareAllFlexFormsInRecord(), DataHandler\deleteRecord(), DataHandler\doesRecordExist(), MissingRelationsCommand\findRelationsToNonExistingRecords(), CleanerCommand\genTree_traverse(), and ReferenceIndex\updateRefIndexTable().

static getRecordsByField (   $theTable,
  $theField,
  $theValue,
  $whereClause = '',
  $groupBy = '',
  $orderBy = '',
  $limit = '',
  $useDeleteClause = true,
  $queryBuilder = null 
)
static

Returns records from table, $theTable, where a field ($theField) equals the value, $theValue The records are returned in an array If no records were selected, the function returns nothing

Parameters
string$theTableTable name present in $GLOBALS['TCA']
string$theFieldField to select on
string$theValueValue that $theField must match
string$whereClauseOptional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
string$groupByOptional GROUP BY field(s), if none, supply blank string.
string$orderByOptional ORDER BY field(s), if none, supply blank string.
string$limitOptional LIMIT value ([begin,]max), if none, supply blank string.
bool$useDeleteClauseUse the deleteClause to check if a record is deleted (default TRUE)
null | QueryBuilder$queryBuilderThe queryBuilder must be provided, if the parameter $whereClause is given and the concept of prepared statement was used. Example within self::firstDomainRecord()
Returns
mixed Multidimensional array with selected records (if any is selected)

Definition at line 225 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, GeneralUtility\intExplode(), GeneralUtility\makeInstance(), QueryHelper\parseGroupBy(), QueryHelper\parseOrderBy(), and QueryHelper\stripLogicalOperatorPrefix().

Referenced by PageLinkHandler\canHandleLink(), BackendUserAuthentication\checkFullLanguagesAccess(), DataHandler\copyL10nOverlayRecords(), DataHandler\deleteL10nOverlayRecords(), SoftReferenceIndex\getPageIdFromAlias(), LocalizationRepository\getRecordLocalization(), DataHandler\getRecordsWithSameValue(), BackendController\handlePageEditing(), PageLayoutController\makeQuickEditMenu(), DataHandler\moveL10nOverlayRecords(), DeletedRecords\setData(), and RteHtmlParser\TS_links_rte().

static getRecordsSortedByTitle ( array  $fields,
  $table,
  $titleField,
  $where = '' 
)
staticprotected

Returns an array of all non-deleted records of a table sorted by a given title field. The value of the title field will be replaced by the return value of self::getRecordTitle() before the sorting is performed.

Parameters
array$fieldsFields to select
string$tableTable name
string$titleFieldField that will contain the record title
string$whereAdditional where clause
Returns
array Array of sorted records

Definition at line 1310 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance(), ArrayUtility\sortArraysByKey(), and QueryHelper\stripLogicalOperatorPrefix().

static getRecordTitle (   $table,
  $row,
  $prep = false,
  $forceResult = true 
)
static

Returns the "title"-value in record, $row, from table, $table The field(s) from which the value is taken is determined by the "ctrl"-entries 'label', 'label_alt' and 'label_alt_force'

Parameters
string$tableTable name, present in TCA
array$rowRow from table
bool$prepIf set, result is prepared for output: The output is cropped to a limited length (depending on BE_USER->uc['titleLen']) and if no value is found for the title, '[No title]' is returned (localized). Further, the output is htmlspecialchars()'ed
bool$forceResultIf set, the function always returns an output. If no value is found for the title, '[No title]' is returned (localized).
Returns
string

Definition at line 2113 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\callUserFunction(), and GeneralUtility\trimExplode().

Referenced by ValidatorTask\buildMail(), IntegrityService\checkLocalization(), Export\export_addRecord(), RecordHistory\generateTitle(), ValidatorTask\getAdditionalInformation(), Clipboard\getContentFromTab(), DocumentTemplate\getHeader(), PageLayoutController\getHeaderFlashMessagesForCurrentPid(), SuggestWizardDefaultReceiver\getLabel(), LinkAnalyzer\getLinkStatistics(), DocumentTemplate\getPageInfo(), ElementInformationController\getPageTitle(), LiveSearch\getRecordArray(), PagePositionMap\getRecordHeader(), MetaInformation\getRecordInformation(), DataHandler\getRecordPropertiesFromRow(), PageLinkHandler\getRecordsOnExpandedPage(), FormManagerController\getRecordTitle(), ElementBrowserRecordList\linkWrapItems(), AbstractDatabaseRecordList\linkWrapItems(), DatabaseIntegrityCheck\lostRecords(), InfoPageTyposcriptConfigController\main(), MoveElementController\main(), LinkValidatorReport\main(), ImportExportController\makeConfigurationForm(), DatabaseRecordList\makeControl(), VersionModuleController\pageSubContent(), ClickMenu\printDBClickMenu(), RelationHandler\readyForInterface(), OuterWrapContainer\render(), DatabaseRecordList\renderListRow(), DeletedRecordsController\transform(), VersionModuleController\versioningMgm(), and ActionTask\viewEditRecord().

static getRecordTitlePrep (   $title,
  $titleLength = 0 
)
static

Crops a title string to a limited length and if it really was cropped, wrap it in a |, which offers a tooltip with the original title when moving mouse over it.

Parameters
string$titleThe title string to be cropped
int$titleLengthCrop title after this length - if not set, BE_USER->uc['titleLen'] is used
Returns
string The processed title string, wrapped in | if cropped

Definition at line 2189 of file backend/Classes/Utility/BackendUtility.php.

References MathUtility\canBeInterpretedAsInteger().

Referenced by UserFileInlineLabelService\getInlineLabel(), ElementBrowserRecordList\linkWrapItems(), OuterWrapContainer\render(), and InlineRecordContainer\renderForeignRecordHeader().

static getRecordToolTip ( array  $row,
  $table = 'pages' 
)
static

Returns the combined markup for Bootstraps tooltips

Parameters
array$row
string$table
Returns
string

Definition at line 1873 of file backend/Classes/Utility/BackendUtility.php.

Referenced by PageLayoutView\getIcon(), PagePositionMap\getRecordHeader(), MetaInformation\getRecordInformation(), MoveElementController\main(), and DatabaseRecordList\renderListRow().

static getRecordWSOL (   $table,
  $uid,
  $fields = '*',
  $where = '',
  $useDeleteClause = true,
  $unsetMovePointers = false 
)
static

Like getRecord(), but overlays workspace version if any.

Parameters
string$tableTable name present in $GLOBALS['TCA']
int$uidUID of record
string$fieldsList of fields to select
string$whereAdditional WHERE clause, eg. " AND blablabla = 0
bool$useDeleteClauseUse the deleteClause to check if a record is deleted (default TRUE)
bool$unsetMovePointersIf TRUE the function does not return a "pointer" row for moved records in a workspace
Returns
array Returns the row if found, otherwise nothing

Definition at line 156 of file backend/Classes/Utility/BackendUtility.php.

References $fields, GeneralUtility\inList(), and GeneralUtility\uniqueList().

Referenced by PageLinkHandler\canHandleLink(), ExportPageTreeView\ext_tree(), PageLinkHandler\formatCurrentUrl(), AbstractDatabaseRecordList\generateList(), Clipboard\getContentFromTab(), ResourceFactory\getFileReferenceData(), InfoPageTyposcriptConfigController\getList(), OpendocsToolbarItem\getMenuEntry(), ConditionMatcher\getPageIdByRecord(), AbstractTreeView\getRecord(), PageLinkHandler\getRecordsOnExpandedPage(), DataProvider\getRecordWithWorkspaceOverlay(), DatabaseLanguageRows\getRecordWorkspaceOverlay(), BackendController\handlePageEditing(), ElementInformationController\initDatabaseRecord(), ElementInformationController\initFileOrFolderRecord(), TranslationStatusController\main(), InfoPageTyposcriptConfigController\main(), MoveElementController\main(), ImportExportController\makeConfigurationForm(), DataHandler\moveRecord_procFields(), ClickMenu\printDBClickMenu(), ClickMenu\printNewDBLevel(), OuterWrapContainer\render(), TypoScriptTemplateModuleController\renderList(), AjaxController\switchWorkspaceAction(), and TranslationConfigurationProvider\translationInfo().

static getRuntimeCache ( )
staticprotected

Gets an instance of the runtime cache.

Returns
VariableFrontend

Definition at line 4115 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

static getSignalSlotDispatcher ( )
staticprotected

Get the SignalSlot dispatcher

Returns

Definition at line 4970 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

static getSpecConfParametersFromArray (   $pArr)
static

Takes an array of "[key] = [value]" strings and returns an array with the keys set as keys pointing to the value. Better see it in action! Find example in Inside TYPO3

Parameters
array$pArrArray of "[key] = [value]" strings to convert.
Returns
array

Definition at line 915 of file backend/Classes/Utility/BackendUtility.php.

Referenced by RteHtmlParser\RTE_transform(), and RichTextElement\RTEtsConfigParams().

static getSpecConfParts (   $defaultExtrasString)
static

Parses "defaultExtras" of $GLOBALS['TCA'] columns config section to an array. Elements are split by ":" and within those parts, parameters are split by "|".

See unit tests for details.

Parameters
string$defaultExtrasString"defaultExtras" string from columns config
Returns
array

Definition at line 887 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\trimExplode().

Referenced by DataHandler\checkValue_flex_procInData_travDS(), BackendUtilityTest\getSpecConfPartsSplitsDefaultExtras(), InputColorPickerElement\render(), InputTextElement\render(), RsaInputElement\render(), SelectMultipleSideBySideElement\render(), SelectCheckBoxElement\render(), SelectSingleBoxElement\render(), TextElement\render(), RichTextElement\render(), and RichTextNodeResolver\resolve().

static getSQLselectableList (   $in_list,
  $tablename,
  $default_tablename 
)
static

Returns a list of pure ints based on $in_list being a list of records with table-names prepended. Ex: $in_list = "pages_4,tt_content_12,45" would result in a return value of "4,45" if $tablename is "pages" and $default_tablename is 'pages' as well.

Parameters
string$in_listInput list
string$tablenameTable name from which ids is returned
string$default_tablename$default_tablename denotes what table the number '45' is from (if nothing is prepended on the value)
Returns
string List of ids
Deprecated:
since TYPO3 CMS 8, will be removed in TYPO3 CMS 9.

Definition at line 315 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\logDeprecatedFunction().

static getTcaFieldConfiguration (   $table,
  $field 
)
static

Gets the TCA configuration of a field.

Parameters
string$tableName of the table
string$fieldName of the field
Returns
array

Definition at line 4899 of file backend/Classes/Utility/BackendUtility.php.

Referenced by ElementEntityProcessor\createNewDependentElementChildReferenceCallback(), and ElementEntityProcessor\createNewDependentElementParentReferenceCallback().

static getTCAtypes (   $table,
  $rec,
  $useFieldNameAsKey = false 
)
static

Returns the "types" configuration parsed into an array for the record, $rec, from table, $table

Parameters
string$tableTable name (present in TCA)
array$recRecord from $table
bool$useFieldNameAsKeyIf $useFieldNameAsKey is set, then the fieldname is associative keys in the return array, otherwise just numeric keys.
Returns
array|NULL

Definition at line 728 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS, and GeneralUtility\trimExplode().

Referenced by DataHandler\fillInFieldArray(), and BackendUtilityTest\getTCAtypesReturnsCorrectValues().

static getTCAtypeValue (   $table,
  $row 
)
static

Returns the "type" value of $rec from $table which can be used to look up the correct "types" rendering section in $GLOBALS['TCA'] If no "type" field is configured in the "ctrl"-section of the $GLOBALS['TCA'] for the table, zero is used. If zero is not an index in the "types" section of $GLOBALS['TCA'] for the table, then the $fieldValue returned will default to 1 (no matter if that is an index or not)

Note: This method is very similar to the type determination of FormDataProvider/DatabaseRecordTypeValue, however, it has two differences: 1) The method in TCEForms also takes care of localization (which is difficult to do here as the whole infrastructure for language overlays is only in TCEforms). 2) The $row array looks different in TCEForms, as in there it's not the raw record but the prepared data from other providers is handled, which changes e.g. how "select" and "group" field values are stored, which makes different processing of the "foreign pointer field" type field variant necessary.

Parameters
string$tableTable name present in TCA
array$rowRecord from $table
Exceptions
RuntimeException
Returns
string Field value
See also
getTCAtypes()

Definition at line 828 of file backend/Classes/Utility/BackendUtility.php.

References $GLOBALS.

Referenced by DataHandler\checkValue_flex_procInData_travDS(), and DataHandler\fillInFieldArray().

static getTCEFORM_TSconfig (   $table,
  $row 
)
static

Returns TSConfig for the TCEFORM object in Page TSconfig. Used in TCEFORMs

Parameters
string$tableTable name present in TCA
array$rowRow from table
Returns
array

Definition at line 3825 of file backend/Classes/Utility/BackendUtility.php.

References ArrayUtility\mergeRecursiveWithOverrule().

Referenced by FormEngineUtility\getTSconfigForTableRow(), AddController\init(), ListController\main(), and NewContentElementController\removeInvalidElements().

static getTSconfig_pidValue (   $table,
  $uid,
  $pid 
)
static

Find the real PID of the record (with $uid from $table). This MAY be impossible if the pid is set as a reference to the former record or a page (if two records are created at one time). NOTICE: Make sure that the input PID is never negative because the record was an offline version! Therefore, you should always use BackendUtility::fixVersioningPid($table,$row); on the data you input before calling this function!

Parameters
string$tableTable name
int$uidRecord uid
int$pidRecord pid, could be negative then pointing to a record from same table whose pid to find and return
Returns
int

Definition at line 3870 of file backend/Classes/Utility/BackendUtility.php.

References MathUtility\canBeInterpretedAsInteger().

Referenced by DataHandler\copyL10nOverlayRecords().

static getTSCpid (   $table,
  $uid,
  $pid 
)
static

Returns the REAL pid of the record, if possible. If both $uid and $pid is strings, then pid=-1 is returned as an error indication.

Parameters
string$tableTable name
int$uidRecord uid
int$pidRecord pid
Returns
array Array of two ints; first is the REAL PID of a record and if its a new record negative values are resolved to the true PID, second value is the PID value for TSconfig (uid if table is pages, otherwise the pid)

Definition at line 3957 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DataHandler\deleteRecord(), DataHandler\getOriginalParentOfRecord(), and DataHandler\moveRecord_raw().

static getTSCpidCached (   $table,
  $uid,
  $pid 
)
static

Return the real pid of a record and caches the result. The non-cached method needs database queries to do the job, so this method can be used if code sometimes calls the same record multiple times to save some queries. This should not be done if the calling code may change the same record meanwhile.

Parameters
string$tableTablename
string$uidUID value
string$pidPID value
Returns
array Array of two integers; first is the real PID of a record, second is the PID value for TSconfig.

Definition at line 3930 of file backend/Classes/Utility/BackendUtility.php.

Referenced by LinkBrowserController\getCurrentPageId(), and RichTextNodeResolver\resolve().

static getUpdateSignalCode ( )
static

Call to update the page tree frame (or something else..?) if this is set by the function setUpdateSignal(). It will return some JavaScript that does the update

Returns
string HTML javascript code
See also
BackendUtility::setUpdateSignal()
::sectionEnd

Definition at line 3493 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\callUserFunction().

Referenced by DocumentTemplate\endPage(), and ModuleTemplate\renderContent().

static getUserNames (   $fields = 'username,
usergroup  ,
usergroup_cached_list  ,
uid'  ,
  $where = '' 
)
static

Returns an array with be_users records of all user NOT DELETED sorted by their username Keys in the array is the be_users uid

Parameters
string$fieldsOptional $fields list (default: username,usergroup,usergroup_cached_list,uid) can be used to set the selected fields
string$whereOptional $where clause (fx. "AND username='pete'") can be used to limit query
Returns
array

Definition at line 1272 of file backend/Classes/Utility/BackendUtility.php.

References $fields, and GeneralUtility\trimExplode().

Referenced by HistoryService\__construct(), AbstractController\createUserAndGroupListForSelectOptions(), RecordHistory\displayHistory(), PermissionController\editAction(), StagesService\getBackendUsers(), PermissionAjaxController\renderUserSelector(), and StagesService\resolveBackendUserIds().

static getWorkspaceVersionOfRecord (   $workspace,
  $table,
  $uid,
  $fields = '*' 
)
static
static getWorkspaceWhereClause (   $table,
  $workspaceId = null 
)
static

Get additional where clause to select records of a specific workspace (includes live as well).

Parameters
string$tableTable name
int$workspaceIdWorkspace ID
Returns
string Workspace where clause

Definition at line 4660 of file backend/Classes/Utility/BackendUtility.php.

static helpTextArray (   $table,
  $field 
)
static

Returns CSH help text (description), if configured for, as an array (title, description)

Parameters
string$tableTable name
string$fieldField name
Returns
array With keys 'description' (raw, as available in locallang), 'title' (optional), 'moreInfo'

Definition at line 2799 of file backend/Classes/Utility/BackendUtility.php.

static isModuleSetInTBE_MODULES (   $modName)
static

Returns TRUE if $modName is set and is found as a main- or submodule in $TBE_MODULES array

Parameters
string$modNameModule name
Returns
bool

Definition at line 4162 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\trimExplode().

Referenced by VersionModuleController\adminLinks(), ClickMenu\DB_edit(), PreviewController\generateJavascript(), BackendController\generateJavascript(), AdminPanelView\getEditModule(), VersionModuleController\main(), and BackendUserAuthentication\modAccess().

static isRecordLocked (   $table,
  $uid 
)
static

Returns information about whether the record from table, $table, with uid, $uid is currently locked (edited by another user - which should issue a warning). Notice: Locking is not strictly carried out since locking is abandoned when other backend scripts are activated - which means that a user CAN have a record "open" without having it locked. So this just serves as a warning that counts well in 90% of the cases, which should be sufficient.

Parameters
string$tableTable name
int$uidRecord uid
Returns
array

Definition at line 3747 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DatabaseRecordList\renderListRow(), and PageLayoutView\tt_content_drawHeader().

static isRootLevelRestrictionIgnored (   $table)
static

Whether to ignore restrictions on root-level records. The regular behaviour is that records on the root-level (page-id 0) only can be accessed by admin users.

Parameters
string$tableName of the table
Returns
bool

Definition at line 4929 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DatabaseUserPermissionCheck\addData(), DataHandler\checkRecordInsertAccess(), DataHandler\doesRecordExist(), WorkspaceService\isPageAccessibleForCurrentUser(), DataHandler\isTableAllowedForThisPage(), and WorkspaceService\selectAllVersionsFromPages().

static isWebMountRestrictionIgnored (   $table)
static

Whether to ignore restrictions on a web-mount of a table. The regular behaviour is that records to be accessed need to be in a valid user's web-mount.

Parameters
string$tableName of the table
Returns
bool

Definition at line 4916 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DataHandler\doesRecordExist().

static lockRecords (   $table = '',
  $uid = 0,
  $pid = 0 
)
static

Unlock or Lock a record from $table with $uid If $table and $uid is not set, then all locking for the current BE_USER is removed!

Parameters
string$tableTable name
int$uidRecord uid
int$pidRecord pid
Returns
void

Definition at line 3703 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

Referenced by AbstractUserAuthentication\logoff(), RecordList\mainAction(), and EditDocumentController\mainAction().

static makeConfigForm (   $configArray,
  $defaults,
  $dataPrefix 
)
static

Makes a form for configuration of some values based on configuration found in the array $configArray, with default values from $defaults and a data-prefix $dataPrefix <form>-tags must be supplied separately Needs more documentation and examples, in particular syntax for configuration array. See Inside TYPO3. That's were you can expect to find example, if anywhere.

Parameters
array$configArrayField configuration code.
array$defaultsDefaults
string$dataPrefixPrefix for formfields
Returns
string HTML for a form.
Deprecated:
since TYPO3 CMS 8, will be removed in TYPO3 CMS 9.

Definition at line 2735 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\logDeprecatedFunction().

static movePlhOL (   $table,
$row 
)
static

Checks if record is a move-placeholder (t3ver_state==VersionState::MOVE_PLACEHOLDER) and if so it will set $row to be the pointed-to live record (and return TRUE)

Parameters
string$tableTable name
array$rowRow (passed by reference) - must be online record!
Returns
bool TRUE if overlay is made.
See also
PageRepository::movePlhOl()

Definition at line 4530 of file backend/Classes/Utility/BackendUtility.php.

References Enumeration\cast(), and VersionState\MOVE_PLACEHOLDER.

Referenced by VersionsCommand\main().

static openPageTree (   $pid,
  $clearExpansion 
)
static

Opens the page tree to the specified page id

Parameters
int$pidPage id.
bool$clearExpansionIf set, then other open branches are closed.
Returns
void

Definition at line 560 of file backend/Classes/Utility/BackendUtility.php.

Referenced by BackendController\handlePageEditing().

static processParams (   $params)
static

Returns an array with key=>values based on input text $params $params is exploded by line-breaks and each line is supposed to be on the syntax [key] = [some value] These pairs will be parsed into an array an returned.

Parameters
string$paramsString of parameters on multiple lines to parse into key-value pairs (see function description)
Returns
array
Deprecated:
since TYPO3 CMS 8, will be removed in TYPO3 CMS 9.

Definition at line 4844 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\logDeprecatedFunction().

static readPageAccess (   $id,
  $perms_clause 
)
static

Returns a page record (of page with $id) with an extra field "_thePath" set to the record path IF the WHERE clause, $perms_clause, selects the record. Thus is works as an access check that returns a page record if access was granted, otherwise not. If $id is zero a pseudo root-page with "_thePath" set is returned IF the current BE_USER is admin. In any case ->isInWebMount must return TRUE for the user (regardless of $perms_clause)

Parameters
int$idPage uid for which to check read-access
string$perms_clauseThis is typically a value generated with static::getBackendUserAuthentication()->getPagePermsClause(1);
Returns
array|bool Returns page record if OK, otherwise FALSE.

Definition at line 695 of file backend/Classes/Utility/BackendUtility.php.

Referenced by SuggestWizardDefaultReceiver\checkRecordAccess(), ExtdirectTreeCommands\clearCacheOfPage(), ViewModuleController\getAdminCommand(), LiveSearch\getEditLink(), PageLayoutView\getExternalTables(), RecordHistory\hasPageAccess(), NewContentElementController\init(), NewRecordController\init(), PageLayoutController\init(), ElementInformationController\initDatabaseRecord(), LinkValidatorReport\initialize(), RecyclerModuleController\initializeAction(), PermissionController\initializeAction(), InfoModuleController\main(), PageFunctionsController\main(), MoveElementController\main(), VersionModuleController\main(), TypoScriptTemplateModuleController\main(), ImportExportController\main(), DataHandlerHook\moveRecord_wsPlaceholders(), PagePathViewHelper\renderStatic(), ElementHistoryController\setPagePath(), and ActionTask\viewRecordList().

static referenceCount (   $table,
  $ref,
  $msg = '',
  $count = null 
)
static

Counting references to a record/file

Parameters
string$tableTable name (or "_FILE" if its a file)
string$refReference: If table, then int-uid, if _FILE, then file reference (relative to PATH_site)
string$msgMessage with s, eg. "There were s records pointing to this file!
string | NULL$countReference count
Returns
string Output string (or int count value if no msg string specified)

Definition at line 4186 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\isFirstPartOfStr(), and PathUtility\stripPathSitePrefix().

Referenced by ClickMenu\DB_delete(), ClickMenu\FILE_delete(), DatabaseRecordList\makeControl(), and FileList\makeEdit().

static replaceL10nModeFields (   $table,
array  $row 
)
staticprotected

Replace field values in given row with values from the original language if l10n_mode TCA settings require to do so.

Parameters
string$tableTable name
array$rowRow to fill with original language values
Returns
array Row with values from the original language

Definition at line 2081 of file backend/Classes/Utility/BackendUtility.php.

static RTEsetup (   $RTEprop,
  $table,
  $field,
  $type = '' 
)
static

Returns processed RTE setup from an array with TSconfig. Merges table and type specific RTE configuration into 'default.'

Parameters
array$RTEpropThe properties of Page TSconfig in the key "RTE.
string$tableTable name
string$fieldField name
string$typeType value of the current record (like from CType of tt_content)
Returns
array Array with the configuration for the RTE

Definition at line 4064 of file backend/Classes/Utility/BackendUtility.php.

References ArrayUtility\mergeRecursiveWithOverrule().

Referenced by DataHandler\checkValue_flex_procInData_travDS(), DataHandler\fillInFieldArray(), SelectImageController\initVariables(), BrowseLinksController\initVariables(), ParseHtmlController\main_parse_html(), UserElementsController\main_user(), RichTextElement\render(), and RichTextNodeResolver\resolve().

static selectVersionsOfRecord (   $table,
  $uid,
  $fields = '*',
  $workspace = 0,
  $includeDeletedRecords = false,
  $row = null 
)
static

Select all versions of a record, ordered by version id (DESC)

Parameters
string$tableTable name to select from
int$uidRecord uid for which to find versions.
string$fieldsField list to select
int | NULL$workspaceSearch in workspace ID and Live WS, if 0 search only in LiveWS, if NULL search in all WS.
bool$includeDeletedRecordsIf set, deleted-flagged versions are included! (Only for clean-up script!)
array$rowThe current record
Returns
array|NULL Array of versions of table/uid

Definition at line 4294 of file backend/Classes/Utility/BackendUtility.php.

References $fields, GeneralUtility\makeInstance(), and GeneralUtility\trimExplode().

Referenced by DataHandler\deleteVersionsForRecord(), OrphanRecordsCommand\findAllConnectedRecordsInPage(), CleanFlexFormsCommand\findAllDirtyFlexformsInPage(), CleanerCommand\genTree_traverse(), VersionModuleController\lookForOwnVersions(), VersionsCommand\main(), DatabaseRecordList\makeControl(), and VersionModuleController\versioningMgm().

static setUpdateSignal (   $set = '',
  $params = '' 
)
static

Call to update the page tree frame (or something else..?) after use 'updatePageTree' as a first parameter will set the page tree to be updated.

Parameters
string$setKey to set the update signal. When setting, this value contains strings telling WHAT to set. At this point it seems that the value "updatePageTree" is the only one it makes sense to set. If empty, all update signals will be removed.
mixed$paramsAdditional information for the update signal, used to only refresh a branch of the tree
Returns
void
See also
BackendUtility::getUpdateSignalCode()

Definition at line 3466 of file backend/Classes/Utility/BackendUtility.php.

Referenced by EditDocumentController\closeDocument(), FileController\finish(), SimpleDataHandlerController\main(), SetupModuleController\main(), and FileController\mainAction().

static shortcutExists (   $url)
static

Exists already a shortcut entry for this TYPO3 url?

Parameters
string$url
Returns
bool

Definition at line 4941 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DocumentTemplate\makeShortcutIcon(), ModuleTemplate\makeShortcutIcon(), and ShortcutToolbarItem\tryAddingTheShortcut().

static& softRefParserObj (   $spKey)
static

Returns soft-reference parser for the softRef processing type Usage: $softRefObj = &BackendUtility::softRefParserObj('[parser key]');

Parameters
string$spKeysoftRef parser key
Returns
mixed If available, returns Soft link parser object.

Definition at line 4088 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\getUserObj().

Referenced by ReferenceIndex\getRelations(), and ReferenceIndex\getRelations_flexFormCallBack().

static splitTable_Uid (   $str)
static

Makes an backwards explode on the $str and returns an array with ($table, $uid). Example: tt_content_45 => array('tt_content', 45)

Parameters
string$str[tablename]_[uid] string to explode
Returns
array

Definition at line 299 of file backend/Classes/Utility/BackendUtility.php.

Referenced by UserFileInlineLabelService\getInlineLabel(), TcaInputPlaceholders\getRelatedGroupFieldUids(), and InlineRecordContainer\renderForeignRecordHeader().

static time (   $value,
  $withSeconds = true 
)
static

Returns $value (in seconds) formatted as hh:mm:ss For instance $value = 3600 + 60*2 + 3 should return "01:02:03"

Parameters
int$valueTime stamp, seconds
bool$withSecondsOutput hh:mm:ss. If FALSE: hh:mm
Returns
string Formatted time

Definition at line 1473 of file backend/Classes/Utility/BackendUtility.php.

Referenced by TcaRecordTitle\getRecordTitleForInputType().

static titleAltAttrib (   $content)
static

Returns alt="" and title="" attributes with the value of $content.

Parameters
string$contentValue for 'alt' and 'title' attributes (will be htmlspecialchars()'ed before output)
Returns
string
Deprecated:
since TYPO3 CMS 8, will be removed in TYPO3 CMS 9.

Definition at line 1539 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\logDeprecatedFunction().

static titleAttribForPages (   $row,
  $perms_clause = '',
  $includeAttrib = true 
)
static

Returns title-attribute information for a page-record informing about id, alias, doktype, hidden, starttime, endtime, fe_group etc.

Parameters
array$rowInput must be a page row ($row) with the proper fields set (be sure - send the full range of fields for the table)
string$perms_clauseThis is used to get the record path of the shortcut page, if any (and doktype==4)
bool$includeAttribIf $includeAttrib is set, then the 'title=""' attribute is wrapped about the return value, which is in any case htmlspecialchar()'ed already
Returns
string

Definition at line 1780 of file backend/Classes/Utility/BackendUtility.php.

References Enumeration\cast(), VersionState\DELETE_PLACEHOLDER, PageRepository\DOKTYPE_LINK, PageRepository\DOKTYPE_MOUNTPOINT, PageRepository\DOKTYPE_SHORTCUT, GeneralUtility\intExplode(), VersionState\MOVE_PLACEHOLDER, VersionState\MOVE_POINTER, VersionState\NEW_PLACEHOLDER, VersionState\NEW_PLACEHOLDER_VERSION, and PageRepository\SHORTCUT_MODE_NONE.

Referenced by BrowseTreeView\getTitleAttrib().

static translationCount (   $table,
  $ref,
  $msg = '' 
)
static

Counting translations of records

Parameters
string$tableTable name
string$refReference: the record's uid
string$msgMessage with s, eg. "This record has s translation(s) which will be deleted, too!
Returns
string Output string (or int count value if no msg string specified)

Definition at line 4237 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\makeInstance().

Referenced by ClickMenu\DB_delete(), DatabaseRecordList\makeControl(), and PageLayoutView\tt_content_drawHeader().

static TYPO3_copyRightNotice ( )
static

Prints TYPO3 Copyright notice for About Modules etc. modules.

Warning: DO NOT prevent this notice from being shown in ANY WAY. According to the GPL license an interactive application must show such a notice on start-up ('If the program is interactive, make it output a short notice... ' - see GPL.txt) Therefore preventing this notice from being properly shown is a violation of the license, regardless of whether you remove it or use a stylesheet to obstruct the display.

Returns
string Text/Image (HTML) for copyright notice.

Definition at line 4760 of file backend/Classes/Utility/BackendUtility.php.

Referenced by ModulesController\indexAction().

static unsetMenuItems (   $modTSconfig,
  $itemArray,
  $TSref 
)
static

Removes menu items from $itemArray if they are configured to be removed by TSconfig for the module ($modTSconfig) See Inside TYPO3 about how to program modules and use this API.

Parameters
array$modTSconfigModule TS config array
array$itemArrayArray of items from which to remove items.
string$TSref$TSref points to the "object string" in $modTSconfig
Returns
array The modified $itemArray is returned.

Definition at line 3443 of file backend/Classes/Utility/BackendUtility.php.

Referenced by PageLayoutController\makeActionMenu(), TaskModuleController\menuConfig(), and BaseScriptClass\menuConfig().

static versioningPlaceholderClause (   $table)
static

Will return where clause de-selecting new(/deleted)-versions from other workspaces. If in live-workspace, don't show "MOVE-TO-PLACEHOLDERS" records if versioningWS is 2 (allows moving)

Parameters
string$tableTable name
Returns
string Where clause if applicable.

Definition at line 4644 of file backend/Classes/Utility/BackendUtility.php.

References VersionState\DEFAULT_STATE.

Referenced by LocalizationRepository\getExcludeQueryPart(), and AbstractDatabaseRecordList\makeQueryArray().

static viewOnClick (   $pageUid,
  $backPath = '',
  $rootLine = null,
  $anchorSection = '',
  $alternativeUrl = '',
  $additionalGetVars = '',
  $switchFocus = true 
)
static

Returns a JavaScript string for viewing the page id, $id It will detect the correct domain name if needed and provide the link with the right back path. Also it will re-use any window already open.

Parameters
int$pageUidPage UID
string$backPathMust point back to TYPO3_mainDir (where the site is assumed to be one level above)
array | NULL$rootLineIf root line is supplied the function will look for the first found domain record and use that URL instead (if found)
string$anchorSectionOptional anchor to the URL
string$alternativeUrlAn alternative URL that, if set, will ignore other parameters except $switchFocus: It will return the window.open command wrapped around this URL!
string$additionalGetVarsAdditional GET variables.
bool$switchFocusIf TRUE, then the preview window will gain the focus.
Returns
string

Definition at line 2976 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\getUserObj(), GeneralUtility\makeInstance(), and GeneralUtility\quoteJSvalue().

Referenced by VersionModuleController\adminLinks(), ClickMenu\DB_view(), EditDocumentController\generatePreviewCode(), InfoModuleController\getButtons(), PageFunctionsController\getButtons(), DatabaseRecordList\getButtons(), VersionModuleController\getButtons(), ImportExportController\getButtons(), TypoScriptTemplateModuleController\getButtons(), NewRecordController\getButtons(), DatabaseRecordList\getDocHeaderButtons(), ElementInformationController\getRecordActions(), PermissionController\initializeView(), AbstractDatabaseRecordList\linkWrapItems(), PageLayoutController\main(), PageLayoutController\makeButtons(), DatabaseRecordList\makeControl(), TranslationStatusController\renderL10nTable(), BackendUtilityTest\viewOnClickReturnsOnClickCodeWithAlternativeUrl(), DocumentTemplate\viewPageIcon(), and WorkspaceService\viewSingleRecord().

static workspaceOL (   $table,
$row,
  $wsid = -99,
  $unsetMovePointers = false 
)
static

Workspace Preview Overlay Generally ALWAYS used when records are selected based on uid or pid. If records are selected on other fields than uid or pid (eg. "email = ....") then usage might produce undesired results and that should be evaluated on individual basis. Principle; Record online! => Find offline? Recently, this function has been modified so it MAY set $row to FALSE. This happens if a version overlay with the move-id pointer is found in which case we would like a backend preview. In other words, you should check if the input record is still an array afterwards when using this function.

Parameters
string$tableTable name
array$rowRecord array passed by reference. As minimum, the "uid" and "pid" fields must exist! Fake fields cannot exist since the fields in the array is used as field names in the SQL look up. It would be nice to have fields like "t3ver_state" and "t3ver_mode_id" as well to avoid a new lookup inside movePlhOL().
int$wsidWorkspace ID, if not specified will use static::getBackendUserAuthentication()->workspace
bool$unsetMovePointersIf TRUE the function does not return a "pointer" row for moved records in a workspace
Returns
void
See also
fixVersioningPid()

Definition at line 4453 of file backend/Classes/Utility/BackendUtility.php.

References Enumeration\cast(), ExtensionManagementUtility\isLoaded(), VersionState\MOVE_PLACEHOLDER, and VersionState\MOVE_POINTER.

Referenced by WorkspaceService\canCreatePreviewLink(), DataHandler\deleteL10nOverlayRecords(), Export\export_addRecord(), ExtendedTemplateService\ext_getAllTemplates(), ExtendedTemplateService\ext_getFirstTemplate(), DataHandler\fillInFieldArray(), DataHandlerHook\findPageElementsForVersionSwap(), DataHandlerHook\findPageIdsForVersionStateChange(), AbstractTreeView\getDataNext(), FlexFormTools\getDataStructureIdentifierFromRecord(), TranslationStatusController\getLangStatus(), PageLayoutView\getNonTranslatedTTcontentUids(), BackendLayoutView\getPage(), PageLayoutView\getPageRecordsRecursive(), RecyclerUtility\getRecordPath(), DataHandler\getRecordProperties(), PageLayoutView\getResult(), PageLayoutView\getTable_pages(), BackendController\handlePageEditing(), PageLayoutView\makeOrdinaryList(), PageLayoutController\makeQuickEditMenu(), SuggestWizardDefaultReceiver\makeWorkspaceOverlay(), PageLayoutView\pages_getTree(), PagePositionMap\printContentElementColumns(), DataHandler\remapListedDBRecords(), DataHandler\updateFlexFormData(), and TemplateService\versionOL().

static wrapClickMenuOnIcon (   $content,
  $table,
  $uid = 0,
  $listFrame = true,
  $addParams = '',
  $enDisItems = '',
  $returnTagParameters = false 
)
static

Makes click menu link (context sensitive menu)

Returns $str wrapped in a link which will activate the context sensitive menu for the record ($table/$uid) or file ($table = file) The link will load the top frame with the parameter "&item" which is the table, uid and listFrame arguments imploded by "|": rawurlencode($table.'|'.$uid.'|'.$listFr)

Parameters
string$contentString to be wrapped in link, typ. image tag.
string$tableTable name/File path. If the icon is for a database record, enter the tablename from $GLOBALS['TCA']. If a file then enter the absolute filepath
int$uidIf icon is for database record this is the UID for the record from $table
bool$listFrameTells the top frame script that the link is coming from a "list" frame which means a frame from within the backend content frame.
string$addParamsAdditional GET parameters for the link to the ClickMenu AJAX request
string$enDisItemsEnable / Disable click menu items. Example: "+new,view" will display ONLY these two items (and any spacers in between), "new,view" will display all BUT these two items.
bool$returnTagParametersIf set, will return only the onclick JavaScript, not the whole link.
Returns
string The link wrapped input string.

Definition at line 3066 of file backend/Classes/Utility/BackendUtility.php.

References GeneralUtility\implodeAttributes().

Referenced by FileList\formatDirList(), FileList\formatFileList(), DocumentTemplate\getHeader(), PageLayoutView\getIcon(), DocumentTemplate\getPageInfo(), MetaInformation\getRecordInformation(), DocumentTemplate\getResourceHeader(), InfoPageTyposcriptConfigController\main(), AbstractContainer\previewFieldValue(), OuterWrapContainer\render(), TranslationStatusController\renderL10nTable(), DatabaseRecordList\renderListRow(), BrowseTreeView\wrapIcon(), FolderTreeView\wrapIcon(), PageTreeView\wrapTitle(), and FolderTreeView\wrapTitle().

static wsMapId (   $table,
  $uid 
)
static

Performs mapping of new uids to new versions UID in case of import inside a workspace.

Parameters
string$tableTable name
int$uidRecord uid (of live record placeholder)
Returns
int Uid of offline version if any, otherwise live uid.

Definition at line 4681 of file backend/Classes/Utility/BackendUtility.php.

Referenced by DataHandler\copyRecord_raw(), DataHandler\dbAnalysisStoreExec(), Import\processSoftReferences_substTokens(), DataHandler\remapListedDBRecords(), Import\setFlexFormRelations(), and Import\setRelations().

Member Data Documentation

$tcaTableTypeConfigurationCache = []
staticprotected

Definition at line 63 of file backend/Classes/Utility/BackendUtility.php.