Documentation TYPO3 par Ameos

t3lib_TCEmain Class Reference

List of all members.

Public Member Functions

 start ($data, $cmd, $altUserObject='')
 setMirror ($mirror)
 setDefaultsFromUserTS ($userTS)
 process_uploads ($postFiles)
 process_uploads_traverseArray (&$outputArr, $inputArr, $keyToSet)
 process_datamap ()
 fillInFieldArray ($table, $id, $fieldArray, $incomingFieldArray, $realPid, $status, $tscPID)
 checkModifyAccessList ($table)
 isRecordInWebMount ($table, $id)
 isInWebMount ($pid)
 checkRecordUpdateAccess ($table, $id)
 checkRecordInsertAccess ($insertTable, $pid, $action=1)
 isTableAllowedForThisPage ($page_uid, $checkTable)
 doesRecordExist ($table, $id, $perms)
 doesRecordExist_pageLookUp ($id, $perms)
 doesBranchExist ($inList, $pid, $perms, $recurse)
 pageInfo ($id, $field)
 recordInfo ($table, $id, $fieldList)
 getRecordProperties ($table, $id)
 getRecordPropertiesFromRow ($table, $row)
 setTSconfigPermissions ($fieldArray, $TSConfig_p)
 newFieldArray ($table)
 overrideFieldArray ($table, $data)
 assemblePermissions ($string)
 checkValue ($table, $field, $value, $id, $status, $realPid, $tscPID)
 checkValue_SW ($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $realPid, $recFID, $field, $uploadedFiles, $tscPID)
 checkValue_input ($res, $value, $tcaFieldConf, $PP, $field='')
 checkValue_check ($res, $value, $tcaFieldConf, $PP)
 checkValue_radio ($res, $value, $tcaFieldConf, $PP)
 checkValue_group_select ($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
 checkValue_group_select_file ($valueArray, $tcaFieldConf, $curValue, $uploadedFileArray, $status, $table, $id, $recFID)
 checkValue_flex ($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
 checkValue_flexArray2Xml ($array)
 _DELETE_FLEX_FORMdata (&$valueArrayToRemoveFrom, $deleteCMDS)
 _MOVE_FLEX_FORMdata (&$valueArrayToMoveIn, $moveCMDS, $direction)
 getUnique ($table, $field, $value, $id, $newPid=0)
 checkValue_input_Eval ($value, $evalArray, $is_in)
 checkValue_group_select_processDBdata ($valueArray, $tcaFieldConf, $id, $status, $type)
 checkValue_group_select_explodeSelectGroupValue ($value)
 checkValue_flex_procInData ($dataPart, $dataPart_current, $uploadedFiles, $dataStructArray, $pParams, $callBackFunc='')
 checkValue_flex_procInData_travDS (&$dataValues, $dataValues_current, $uploadedFiles, $DSelements, $pParams, $callBackFunc, $structurePath)
 updateDB ($table, $id, $fieldArray)
 compareFieldArrayWithCurrentAndUnset ($table, $id, $fieldArray)
 insertDB ($table, $id, $fieldArray, $newVersion=FALSE, $suggestedUid=0)
 checkStoredRecord ($table, $id, $fieldArray, $action)
 dbAnalysisStoreExec ()
 removeRegisteredFiles ()
 clear_cache ($table, $uid)
 getPID ($table, $uid)
 process_cmdmap ()
 moveRecord ($table, $uid, $destPid)
 copyRecord ($table, $uid, $destPid, $first=0, $overrideValues=array(), $excludeFields='')
 copyRecord_raw ($table, $uid, $pid, $overrideArray=array())
 insertNewCopyVersion ($table, $fieldArray, $realPid)
 copyRecord_procBasedOnFieldType ($table, $uid, $field, $value, $row, $conf)
 copyRecord_localize ($table, $uid, $language)
 copyRecord_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)
 copyRecord_procFilesRefs ($conf, $uid, $value)
 copyPages ($uid, $destPid)
 copySpecificPage ($uid, $destPid, $copyTablesArray, $first=0)
 versionizeRecord ($table, $id, $label)
 versionizePages ($uid, $label)
 rawCopyPageContent ($old_pid, $new_pid, $copyTablesArray)
 version_swap ($table, $id, $swapWith, $swapContent)
 int_pageTreeInfo ($CPtable, $pid, $counter, $rootID)
 compileAdminTables ()
 fixUniqueInPid ($table, $uid)
 fixCopyAfterDuplFields ($table, $uid, $prevUid, $update, $newData=array())
 extFileFields ($table)
 getCopyHeader ($table, $pid, $field, $value, $count, $prevTitle='')
 prependLabel ($table)
 resolvePid ($table, $pid)
 clearPrefixFromValue ($table, $value)
 remapListedDBRecords ()
 remapListedDBRecords_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)
 remapListedDBRecords_procDBRefs ($conf, $value, $MM_localUid)
 extFileFunctions ($table, $field, $filelist, $func)
 deleteRecord ($table, $uid, $noRecordCheck)
 deletePages ($uid)
 deleteSpecificPage ($uid)
 noRecordsFromUnallowedTables ($inList)
 getSortNumber ($table, $uid, $pid)
 resorting ($table, $pid, $sortRow, $return_SortNumber_After_This_Uid)
 rmComma ($input)
 convNumEntityToByteValue ($input)
 destPathFromUploadFolder ($folder)
 destNotInsideSelf ($dest, $id)
 getExcludeListArray ()
 doesPageHaveUnallowedTables ($page_uid, $doktype)
 deleteClause ($table)
 tableReadOnly ($table)
 tableAdminOnly ($table)
 getInterfacePagePositionID ($uid)
 isReferenceField ($conf)
 getTCEMAIN_TSconfig ($tscPID)
 getTableEntries ($table, $TSconfig)
 setHistory ($table, $id, $logId)
 clearHistory ($table, $id, $keepEntries=10, $maxAgeSeconds=604800)
 log ($table, $recuid, $action, $recpid, $error, $details, $details_nr=0, $data=array(), $event_pid=-1, $NEWid='')
 printLogErrorMessages ($redirect)
 clear_cacheCmd ($cacheCmd)
 removeCacheFiles ()

Public Attributes

 $log_table = 'sys_log'
 $checkStoredRecords = 1
 $checkStoredRecords_loose = 1
 $sortIntervals = 256
 $deleteTree = 0
 $copyTree = 0
 $versionizeTree = 0
 $neverHideAtCopy = 0
 $reverseOrder = 0
 $copyWhichTables = '*'
 $stripslashes_values = 1
 $storeLogMessages = 1
 $enableLogging = 1
 $callBackObj
 $checkSimilar = 1
 $dontProcessTransformations = 0
 $pMap
 $defaultPermissions
 $alternativeFileName = array()
 $data_disableFields = array()
 $defaultValues = array()
 $overrideValues = array()
 $suggestedInsertUids = array()
 $fileFunc
 $last_log_id
 $BE_USER
 $userid
 $username
 $admin
 $exclude_array
 $data = Array()
 $datamap = Array()
 $cmd = Array()
 $cmdmap = Array()
 $uploadedFileArray = array()
 $cachedTSconfig = array()
 $substNEWwithIDs = Array()
 $substNEWwithIDs_table = Array()
 $recUpdateAccessCache = Array()
 $recInsertAccessCache = Array()
 $isRecordInWebMount_Cache = array()
 $isInWebMount_Cache = array()
 $pageCache = Array()
 $copyMappingArray = Array()
 $copyMappingArray_merged = Array()
 $registerDBList = array()
 $dbAnalysisStore = array()
 $removeFilesStore = array()
 $copiedFileMap = array()
 $checkValue_currentRecord = array()

Detailed Description

Definition at line 199 of file class.t3lib_tcemain.php.


Member Function Documentation

t3lib_TCEmain::_DELETE_FLEX_FORMdata &$  valueArrayToRemoveFrom,
deleteCMDS
 

Deletes a flex form element

Parameters:
array &$valueArrayToRemoveFrom: by reference
[type] $deleteCMDS: ... *
Returns:
void

Definition at line 1804 of file class.t3lib_tcemain.php.

t3lib_TCEmain::_MOVE_FLEX_FORMdata &$  valueArrayToMoveIn,
moveCMDS,
direction
 

Deletes a flex form element

Parameters:
array &$valueArrayToMoveIn: by reference
[type] $moveCMDS: ... *
string $direction: 'up' or 'down'
Returns:
void TODO: Like _DELETE_FLEX_FORMdata, this is only a temporary solution!

Definition at line 1825 of file class.t3lib_tcemain.php.

t3lib_TCEmain::assemblePermissions string  ) 
 

Calculates the bitvalue of the permissions given in a string, comma-sep

Parameters:
[type] $string: ...
Returns:
[type] ...

Definition at line 1218 of file class.t3lib_tcemain.php.

References t3lib_div::trimExplode().

t3lib_TCEmain::checkModifyAccessList table  ) 
 

Checking group modify_table access list

Returns true if the user has general access to modify the $table

Parameters:
[type] $table: ...
Returns:
[type] ...

Definition at line 826 of file class.t3lib_tcemain.php.

References t3lib_div::inList(), and tableAdminOnly().

Referenced by process_datamap().

t3lib_TCEmain::checkRecordInsertAccess insertTable,
pid,
action = 1
 

Checks if user may insert a certain record.

Returns true if the user may insert a record from table $insertTable on page $pid

Parameters:
[type] $insertTable: ...
[type] $pid: ...
[type] $action: ...
Returns:
[type] ...

Definition at line 894 of file class.t3lib_tcemain.php.

References doesRecordExist(), getRecordProperties(), isTableAllowedForThisPage(), and log().

Referenced by process_datamap().

t3lib_TCEmain::checkRecordUpdateAccess table,
id
 

Checks if user may update a certain record.

Returns true if the user may update the record given by $table and $id

Parameters:
[type] $table: ...
[type] $id: ...
Returns:
[type] ...

Definition at line 869 of file class.t3lib_tcemain.php.

References doesRecordExist().

Referenced by process_datamap().

t3lib_TCEmain::checkStoredRecord table,
id,
fieldArray,
action
 

Checking stored record to see if the written values are properly updated.

Parameters:
string Record table name
integer Record uid
array Array of field=>value pairs to insert/update
string Action, for logging only.
Returns:
array Selected row
See also:
insertDB(), updateDB()

Definition at line 2434 of file class.t3lib_tcemain.php.

t3lib_TCEmain::checkValue table,
field,
value,
id,
status,
realPid,
tscPID
 

Evaluates a value according to $table/$field settings. This function is for real database fields - NOT FlexForm "pseudo" fields. NOTICE: Calling this function expects this: 1) That the data is saved! (files are copied and so on) 2) That files registered for deletion IS deleted at the end (with ->removeRegisteredFiles() )

Parameters:
string Table name
string Field name
string Value to be evaluated. Notice, this is the INPUT value from the form. The original value (from any existing record) must be manually looked up inside the function if needed - or taken from $currentRecord array.
string The record-uid, mainly - but not exclusively - used for logging
string 'update' or 'new' flag
integer The real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
integer $tscPID
Returns:
array Returns the evaluated $value as key "value" in this array. Can be checked with isset($res['value']) ...

Definition at line 1268 of file class.t3lib_tcemain.php.

References t3lib_div::inList(), and t3lib_div::loadTCA().

Referenced by fillInFieldArray().

t3lib_TCEmain::checkValue_check res,
value,
tcaFieldConf,
PP
 

Evaluates 'check' type values.

Parameters:
array The result array. The processed value (if any!) is set in the 'value' key.
string The value to set.
array Field configuration from TCA
array Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
Returns:
array Modified $res array

Definition at line 1412 of file class.t3lib_tcemain.php.

t3lib_TCEmain::checkValue_flex res,
value,
tcaFieldConf,
PP,
uploadedFiles,
field
 

Evaluates 'flex' type values.

Parameters:
array The result array. The processed value (if any!) is set in the 'value' key.
string The value to set.
array Field configuration from TCA
array Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
array Uploaded files for the field
array Current record array.
string Field name
Returns:
array Modified $res array

Definition at line 1714 of file class.t3lib_tcemain.php.

References t3lib_div::_GP(), t3lib_div::array_merge_recursive_overrule(), t3lib_BEfunc::getFlexFormDS(), and t3lib_div::xml2array().

t3lib_TCEmain::checkValue_flex_procInData dataPart,
dataPart_current,
uploadedFiles,
dataStructArray,
pParams,
callBackFunc = ''
 

Starts the processing the input data for flexforms. This will traverse all sheets / languages and for each it will traverse the sub-structure. See checkValue_flex_procInData_travDS() for more details.

Parameters:
array The 'data' part of the INPUT flexform data
array The 'data' part of the CURRENT flexform data
array The uploaded files for the 'data' part of the INPUT flexform data
array Data structure for the form (might be sheets or not). Only values in the data array which has a configuration in the data structure will be processed.
array A set of parameters to pass through for the calling of the evaluation functions
string Optional call back function, see checkValue_flex_procInData_travDS()
Returns:
array The modified 'data' part.
See also:
checkValue_flex_procInData_travDS()

Definition at line 2070 of file class.t3lib_tcemain.php.

References t3lib_div::resolveSheetDefInDS().

t3lib_TCEmain::checkValue_flex_procInData_travDS &$  dataValues,
dataValues_current,
uploadedFiles,
DSelements,
pParams,
callBackFunc,
structurePath
 

Processing of the sheet/language data array When it finds a field with a value the processing is done by ->checkValue_SW() by default but if a call back function name is given that method in this class will be called for the processing instead.

Parameters:
array New values (those being processed): Multidimensional Data array for sheet/language, passed by reference!
array Current values: Multidimensional Data array. May be empty array() if not needed (for callBackFunctions)
array Uploaded files array for sheet/language. May be empty array() if not needed (for callBackFunctions)
array Data structure which fits the data array
array A set of parameters to pass through for the calling of the evaluation functions / call back function
string Call back function, default is checkValue_SW(). If $this->callBackObj is set to an object, the callback function in that object is called instead.
[type] $structurePath: ...
Returns:
void
See also:
checkValue_flex_procInData()

Definition at line 2109 of file class.t3lib_tcemain.php.

References t3lib_BEfunc::getPagesTSconfig(), t3lib_BEfunc::getSpecConfParts(), t3lib_BEfunc::getTCAtypeValue(), t3lib_BEfunc::RTEgetObj(), and t3lib_BEfunc::RTEsetup().

t3lib_TCEmain::checkValue_flexArray2Xml array  ) 
 

[Describe function...]

Parameters:
[type] $array: ...
Returns:
[type] ...

Definition at line 1787 of file class.t3lib_tcemain.php.

References t3lib_div::array2xml().

t3lib_TCEmain::checkValue_group_select res,
value,
tcaFieldConf,
PP,
uploadedFiles,
field
 

Evaluates 'group' or 'select' type values.

Parameters:
array The result array. The processed value (if any!) is set in the 'value' key.
string The value to set.
array Field configuration from TCA
array Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
[type] $uploadedFiles: ...
string Field name
Returns:
array Modified $res array

Definition at line 1461 of file class.t3lib_tcemain.php.

t3lib_TCEmain::checkValue_group_select_explodeSelectGroupValue value  ) 
 

Explodes the $value, which is a list of files/uids (group select)

Parameters:
string Input string, comma separated values. For each part it will also be detected if a '|' is found and the first part will then be used if that is the case. Further the value will be rawurldecoded.
Returns:
array The value array.

Definition at line 2047 of file class.t3lib_tcemain.php.

References t3lib_div::trimExplode().

t3lib_TCEmain::checkValue_group_select_file valueArray,
tcaFieldConf,
curValue,
uploadedFileArray,
status,
table,
id,
recFID
 

Handling files for group/select function

Parameters:
[type] $valueArray: ...
[type] $tcaFieldConf: ...
[type] $curValue: ...
[type] $uploadedFileArray: ...
[type] $status: ...
[type] $table: ...
[type] $id: ...
[type] $recFID: ...
Returns:
array Modified value array
See also:
checkValue_group_select()

Definition at line 1561 of file class.t3lib_tcemain.php.

References t3lib_div::fixWindowsFilePath(), t3lib_div::formatSize(), t3lib_div::makeInstance(), t3lib_div::removeArrayEntryByValue(), t3lib_div::split_fileref(), t3lib_div::trimExplode(), and t3lib_div::upload_copy_move().

t3lib_TCEmain::checkValue_group_select_processDBdata valueArray,
tcaFieldConf,
id,
status,
type
 

Returns data for group/db and select fields

Parameters:
array Current value array
array TCA field config
integer Record id, used for look-up of MM relations (local_uid)
string Status string ('update' or 'new')
string The type, either 'select' or 'group'
Returns:
array Modified value array

Definition at line 2014 of file class.t3lib_tcemain.php.

References t3lib_div::makeInstance().

t3lib_TCEmain::checkValue_input res,
value,
tcaFieldConf,
PP,
field = ''
 

Evaluate "input" type values.

Parameters:
array The result array. The processed value (if any!) is set in the "value" key.
string The value to set.
array Field configuration from TCA
array Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
string Field name
Returns:
array Modified $res array

Definition at line 1374 of file class.t3lib_tcemain.php.

References t3lib_div::trimExplode().

t3lib_TCEmain::checkValue_input_Eval value,
evalArray,
is_in
 

Evaluation of 'input'-type values based on 'eval' list

Parameters:
string Value
array Array of evaluations to traverse.
string Is-in string
Returns:
string Modified $value

Definition at line 1926 of file class.t3lib_tcemain.php.

t3lib_TCEmain::checkValue_radio res,
value,
tcaFieldConf,
PP
 

Evaluates 'radio' type values.

Parameters:
array The result array. The processed value (if any!) is set in the 'value' key.
string The value to set.
array Field configuration from TCA
array Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
Returns:
array Modified $res array

Definition at line 1435 of file class.t3lib_tcemain.php.

t3lib_TCEmain::checkValue_SW res,
value,
tcaFieldConf,
table,
id,
curValue,
status,
realPid,
recFID,
field,
uploadedFiles,
tscPID
 

Branches out evaluation of a field value based on its type as configured in TCA Can be called for FlexForm pseudo fields as well, BUT must not have $field set if so.

Parameters:
array The result array. The processed value (if any!) is set in the "value" key.
string The value to set.
array Field configuration from TCA
string Table name
integer Return UID
[type] $curValue: ...
[type] $status: ...
integer The real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
[type] $recFID: ...
string Field name. Must NOT be set if the call is for a flexform field (since flexforms are not allowed within flexforms).
[type] $uploadedFiles: ...
[type] $tscPID: ...
Returns:
array Returns the evaluated $value as key "value" in this array.

Definition at line 1328 of file class.t3lib_tcemain.php.

t3lib_TCEmain::clear_cache table,
uid
 

Clearing the cache based on a page being updated If the $table is 'pages' then cache is cleared for all pages on the same level (and subsequent?) Else just clear the cache for the parent page of the record.

Parameters:
string Table name of record that was just updated.
integer UID of updated / inserted record
Returns:
void

Definition at line 2503 of file class.t3lib_tcemain.php.

References t3lib_div::callUserFunction(), t3lib_BEfunc::getTSCpid(), t3lib_extMgm::isLoaded(), and t3lib_div::trimExplode().

t3lib_TCEmain::clear_cacheCmd cacheCmd  ) 
 

Clears the cache based on a command, $cacheCmd

$cacheCmd='pages': Clears cache for all pages. Requires admin-flag to be set for BE_USER $cacheCmd='all': Clears all cache_tables. This is necessary if templates are updated. Requires admin-flag to be set for BE_USER $cacheCmd=[integer]: Clears cache for the page pointed to by $cacheCmd (an integer).

Can call a list of post processing functions as defined in $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] (num array with values being the function references, called by t3lib_div::callUserFunction())

Parameters:
string The cache comment, see above description.
Returns:
void

Definition at line 4719 of file class.t3lib_tcemain.php.

References t3lib_extMgm::isLoaded().

t3lib_TCEmain::clearHistory table,
id,
keepEntries = 10,
maxAgeSeconds = 604800
 

604800 = 60*60*24*7 $keepEntries (int+) defines the number of current entries from sys_history table to keep in addition to the new one which is put in. $maxAgeSeconds (int+) however will set a max age in seconds so that any entry older than current time minus the age removed no matter what. If zero, this is not effective. All snapshots are excluded of course.

Parameters:
[type] $table: ...
[type] $id: ...
[type] $keepEntries: ...
[type] $maxAgeSeconds: ...
Returns:
[type] ...

Definition at line 4595 of file class.t3lib_tcemain.php.

t3lib_TCEmain::clearPrefixFromValue table,
value
 

Removes the prependAtCopy prefix on values

Parameters:
[type] $table: ...
[type] $value: ...
Returns:
[type] ...

Definition at line 3842 of file class.t3lib_tcemain.php.

t3lib_TCEmain::compareFieldArrayWithCurrentAndUnset table,
id,
fieldArray
 

Compares the incoming field array with the current record and unsets all fields which are the same. If the returned array is empty, then the record should not be updated! $fieldArray must be an array.

Parameters:
string Record table name
integer Record uid
array Array of field=>value pairs intended to be inserted into the database. All keys with values matching exactly the current value will be unset!
Returns:
array Returns $fieldArray

Definition at line 2308 of file class.t3lib_tcemain.php.

Referenced by process_datamap().

t3lib_TCEmain::compileAdminTables  ) 
 

List of all tables (those administrators has access to)

Returns:
[type] ...

Definition at line 3674 of file class.t3lib_tcemain.php.

t3lib_TCEmain::convNumEntityToByteValue input  ) 
 

Converts a HTML entity (like {) to the character '123'

Parameters:
string Input string
Returns:
string Output string

Definition at line 4329 of file class.t3lib_tcemain.php.

t3lib_TCEmain::copyPages uid,
destPid
 

Copying pages Main function for copying pages.

Parameters:
integer Page UID to copy
integer Destination PID: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
Returns:
void

Definition at line 3309 of file class.t3lib_tcemain.php.

References t3lib_div::inList().

t3lib_TCEmain::copyRecord table,
uid,
destPid,
first = 0,
overrideValues = array(),
excludeFields = ''