[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/t3lib/ -> class.t3lib_tcemain.php (sommaire)

Contains the TYPO3 Core Engine $Id: class.t3lib_tcemain.php 2574 2007-10-16 17:35:29Z mundaun $ Revised for TYPO3 3.9 October 2005 by Kasper Skaarhoj

Author: Kasper Skaarhoj <kasperYYYY@typo3.com>
Poids: 6363 lignes (267 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

t3lib_TCEmain:: (129 méthodes):
  start()
  setMirror()
  setDefaultsFromUserTS()
  process_uploads()
  process_uploads_traverseArray()
  hook_processDatamap_afterDatabaseOperations()
  process_datamap()
  placeholderShadowing()
  fillInFieldArray()
  checkValue()
  checkValue_SW()
  checkValue_input()
  checkValue_check()
  checkValue_radio()
  checkValue_group_select()
  checkValue_group_select_file()
  checkValue_flex()
  checkValue_flexArray2Xml()
  _DELETE_FLEX_FORMdata()
  _MOVE_FLEX_FORMdata()
  checkValue_inline()
  checkValue_checkMax()
  getUnique()
  checkValue_input_Eval()
  checkValue_group_select_processDBdata()
  checkValue_group_select_explodeSelectGroupValue()
  checkValue_flex_procInData()
  checkValue_flex_procInData_travDS()
  process_cmdmap()
  copyRecord()
  copyPages()
  copySpecificPage()
  copyRecord_raw()
  rawCopyPageContent()
  insertNewCopyVersion()
  copyRecord_procBasedOnFieldType()
  copyRecord_flexFormCallBack()
  copyRecord_procFilesRefs()
  moveRecord()
  moveRecord_procFields()
  moveRecord_procBasedOnFieldType()
  localize()
  deleteAction()
  deleteEl()
  deleteVersionsForRecord()
  undeleteRecord()
  deleteRecord()
  deleteRecord_flexFormCallBack()
  deletePages()
  deleteSpecificPage()
  canDeletePage()
  cannotDeleteRecord()
  deleteRecord_procFields()
  deleteRecord_procBasedOnFieldType()
  versionizeRecord()
  versionizePages()
  version_swap()
  version_clearWSID()
  version_setStage()
  remapListedDBRecords()
  remapListedDBRecords_flexFormCallBack()
  remapListedDBRecords_procDBRefs()
  remapListedDBRecords_procInline()
  processRemapStack()
  checkModifyAccessList()
  isRecordInWebMount()
  isInWebMount()
  checkRecordUpdateAccess()
  checkRecordInsertAccess()
  isTableAllowedForThisPage()
  doesRecordExist()
  doesRecordExist_pageLookUp()
  doesBranchExist()
  tableReadOnly()
  tableAdminOnly()
  destNotInsideSelf()
  getExcludeListArray()
  doesPageHaveUnallowedTables()
  pageInfo()
  recordInfo()
  getRecordProperties()
  getRecordPropertiesFromRow()
  updateDB()
  insertDB()
  checkStoredRecord()
  setHistory()
  clearHistory()
  updateRefIndex()
  getSortNumber()
  resorting()
  setTSconfigPermissions()
  newFieldArray()
  addDefaultPermittedLanguageIfNotSet()
  overrideFieldArray()
  compareFieldArrayWithCurrentAndUnset()
  assemblePermissions()
  rmComma()
  convNumEntityToByteValue()
  destPathFromUploadFolder()
  deleteClause()
  getTCEMAIN_TSconfig()
  getTableEntries()
  getPID()
  dbAnalysisStoreExec()
  removeRegisteredFiles()
  removeCacheFiles()
  int_pageTreeInfo()
  compileAdminTables()
  fixUniqueInPid()
  fixCopyAfterDuplFields()
  extFileFields()
  getUniqueFields()
  isReferenceField()
  getInlineFieldType()
  getCopyHeader()
  prependLabel()
  resolvePid()
  clearPrefixFromValue()
  extFileFunctions()
  noRecordsFromUnallowedTables()
  notifyStageChange()
  notifyStageChange_getEmails()
  isRecordCopied()
  clear_cache()
  clear_cacheCmd()
  log()
  newlog()
  printLogErrorMessages()
  internal_clearPageCache()


Classe: t3lib_TCEmain  - X-Ref

This is the TYPO3 Core Engine class for manipulation of the database
This class is used by eg. the tce_db.php script which provides an the interface for POST forms to this class.

Dependencies:
- $GLOBALS['TCA'] must exist
- $GLOBALS['LANG'] (languageobject) may be preferred, but not fatal.

tce_db.php for further comments and SYNTAX! Also see document 'TYPO3 Core API' for details.

start($data,$cmd,$altUserObject='')   X-Ref
Initializing.
For details, see 'TYPO3 Core API' document.
This function does not start the processing of data, but merely initializes the object

param: array        Data to be modified or inserted in the database
param: array        Commands to copy, move, delete, localize, versionize records.
param: object        An alternative userobject you can set instead of the default, which is $GLOBALS['BE_USER']
return: void

setMirror($mirror)   X-Ref
Function that can mirror input values in datamap-array to other uid numbers.
Example: $mirror[table][11] = '22,33' will look for content in $this->datamap[table][11] and copy it to $this->datamap[table][22] and $this->datamap[table][33]

param: array        This array has the syntax $mirror[table_name][uid] = [list of uids to copy data-value TO!]
return: void

setDefaultsFromUserTS($userTS)   X-Ref
Initializes default values coming from User TSconfig

param: array        User TSconfig array
return: void

process_uploads($postFiles)   X-Ref
Processing of uploaded files.
It turns out that some versions of PHP arranges submitted data for files different if sent in an array. This function will unify this so the internal array $this->uploadedFileArray will always contain files arranged in the same structure.

param: array        $_FILES array
return: void

process_uploads_traverseArray(&$outputArr,$inputArr,$keyToSet)   X-Ref
Traverse the upload array if needed to rearrange values.

param: array        $this->uploadedFileArray passed by reference
param: array        Input array  ($_FILES parts)
param: string        The current $_FILES array key to set on the outermost level.
return: void

hook_processDatamap_afterDatabaseOperations(&$hookObjectsArr, &$status, &$table, &$id, &$fieldArray)   X-Ref
Hook: processDatamap_afterDatabaseOperations
(calls $hookObj->processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $this);)

Note: When using the hook after INSERT operations, you will only get the temporary NEW... id passed to your hook as $id,
but you can easily translate it to the real uid of the inserted record using the $this->substNEWwithIDs array.

param: object        $hookObjectsArr: (reference) Array with hook objects
param: string        $status: (reference) Status of the current operation, 'new' or 'update
param: string        $table: (refrence) The table currently processing data for
param: string        $id: (reference) The record uid currently processing data for, [integer] or [string] (like 'NEW...')
param: array        $fieldArray: (reference) The field array of a record
return: void

process_datamap()   X-Ref
Processing the data-array
Call this function to process the data-array set by start()

return: void

placeholderShadowing($table,$id)   X-Ref
Fix shadowing of data in case we are editing a offline version of a live "New" placeholder record:

param: string        Table name
param: integer        Record uid
return: void

fillInFieldArray($table,$id,$fieldArray,$incomingFieldArray,$realPid,$status,$tscPID)   X-Ref
Filling in the field array
$this->exclude_array is used to filter fields if needed.

param: string        Table name
param: [type]        $id: ...
param: array        Default values, Preset $fieldArray with 'pid' maybe (pid and uid will be not be overridden anyway)
param: array        $incomingFieldArray is which fields/values you want to set. There are processed and put into $fieldArray if OK
param: 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.
param: string        $status = 'new' or 'update'
param: [type]        $tscPID: ...
return: [type]        ...

checkValue($table,$field,$value,$id,$status,$realPid,$tscPID)   X-Ref
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() )

param: string        Table name
param: string        Field name
param: 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.
param: string        The record-uid, mainly - but not exclusively - used for logging
param: string        'update' or 'new' flag
param: 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.
param: integer        $tscPID
return: array        Returns the evaluated $value as key "value" in this array. Can be checked with isset($res['value']) ...

checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$tscPID)   X-Ref
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.

param: array        The result array. The processed value (if any!) is set in the "value" key.
param: string        The value to set.
param: array        Field configuration from TCA
param: string        Table name
param: integer        Return UID
param: [type]        $curValue: ...
param: [type]        $status: ...
param: 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.
param: [type]        $recFID: ...
param: string        Field name. Must NOT be set if the call is for a flexform field (since flexforms are not allowed within flexforms).
param: [type]        $uploadedFiles: ...
param: [type]        $tscPID: ...
return: array        Returns the evaluated $value as key "value" in this array.

checkValue_input($res,$value,$tcaFieldConf,$PP,$field='')   X-Ref
Evaluate "input" type values.

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

checkValue_check($res,$value,$tcaFieldConf,$PP)   X-Ref
Evaluates 'check' type values.

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

checkValue_radio($res,$value,$tcaFieldConf,$PP)   X-Ref
Evaluates 'radio' type values.

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

checkValue_group_select($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field)   X-Ref
Evaluates 'group' or 'select' type values.

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

checkValue_group_select_file($valueArray,$tcaFieldConf,$curValue,$uploadedFileArray,$status,$table,$id,$recFID)   X-Ref
Handling files for group/select function

param: array        Array of incoming file references. Keys are numeric, values are files (basically, this is the exploded list of incoming files)
param: array        Configuration array from TCA of the field
param: string        Current value of the field
param: array        Array of uploaded files, if any
param: string        Status ("update" or ?)
param: string        tablename of record
param: integer        UID of record
param: string        Field identifier ([table:uid:field:....more for flexforms?]
return: array        Modified value array

checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field)   X-Ref
Evaluates 'flex' type values.

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

checkValue_flexArray2Xml($array, $addPrologue=FALSE)   X-Ref
Converts an array to FlexForm XML

param: array        Array with FlexForm data
param: boolean        If set, the XML prologue is returned as well.
return: string        Input array converted to XML

_DELETE_FLEX_FORMdata(&$valueArrayToRemoveFrom,$deleteCMDS)   X-Ref
Deletes a flex form element

param: array        &$valueArrayToRemoveFrom: by reference
param: array        $deleteCMDS: ...     *
return: void

_MOVE_FLEX_FORMdata(&$valueArrayToMoveIn, $moveCMDS, $direction)   X-Ref
Deletes a flex form element

TODO: Like _DELETE_FLEX_FORMdata, this is only a temporary solution!

param: array        &$valueArrayToMoveIn: by reference
param: array        $moveCMDS: ...     *
param: string        $direction: 'up' or 'down'
return: void

checkValue_inline($res,$value,$tcaFieldConf,$PP,$field)   X-Ref
Evaluates 'inline' type values.
(partly copied from the select_group function on this issue)

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

checkValue_checkMax($tcaFieldConf, $valueArray)   X-Ref
Checks if a fields has more items than defined via TCA in maxitems.
If there are more items than allowd, the item list is truncated to the defined number.

param: array        $tcaFieldConf: Field configuration from TCA
param: array        $valueArray: Current value array of items
return: array        The truncated value array of items

getUnique($table,$field,$value,$id,$newPid=0)   X-Ref
Gets a unique value for $table/$id/$field based on $value

param: string        Table name
param: string        Field name for which $value must be unique
param: string        Value string.
param: integer        UID to filter out in the lookup (the record itself...)
param: integer        If set, the value will be unique for this PID
return: string        Modified value (if not-unique). Will be the value appended with a number (until 100, then the function just breaks).

checkValue_input_Eval($value,$evalArray,$is_in)   X-Ref
Evaluation of 'input'-type values based on 'eval' list

param: string        Value to evaluate
param: array        Array of evaluations to traverse.
param: string        Is-in string
return: string        Modified $value

checkValue_group_select_processDBdata($valueArray,$tcaFieldConf,$id,$status,$type,$currentTable)   X-Ref
Returns data for group/db and select fields

param: array        Current value array
param: array        TCA field config
param: integer        Record id, used for look-up of MM relations (local_uid)
param: string        Status string ('update' or 'new')
param: string        The type, either 'select', 'group' or 'inline'
param: string        Table name, needs to be passed to t3lib_loadDBGroup
return: array        Modified value array

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

param: 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.
return: array        The value array.

checkValue_flex_procInData($dataPart,$dataPart_current,$uploadedFiles,$dataStructArray,$pParams,$callBackFunc='')   X-Ref
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.
WARNING: Currently, it traverses based on the actual _data_ array and NOT the _structure_. This means that values for non-valid fields, lKey/vKey/sKeys will be accepted! For traversal of data with a call back function you should rather use class.t3lib_flexformtools.php

param: array        The 'data' part of the INPUT flexform data
param: array        The 'data' part of the CURRENT flexform data
param: array        The uploaded files for the 'data' part of the INPUT flexform data
param: 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.
param: array        A set of parameters to pass through for the calling of the evaluation functions
param: string        Optional call back function, see checkValue_flex_procInData_travDS()  DEPRICATED, use class.t3lib_flexformtools.php instead for traversal!
return: array        The modified 'data' part.

checkValue_flex_procInData_travDS(&$dataValues,$dataValues_current,$uploadedFiles,$DSelements,$pParams,$callBackFunc,$structurePath)   X-Ref
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.

param: array        New values (those being processed): Multidimensional Data array for sheet/language, passed by reference!
param: array        Current values: Multidimensional Data array. May be empty array() if not needed (for callBackFunctions)
param: array        Uploaded files array for sheet/language. May be empty array() if not needed (for callBackFunctions)
param: array        Data structure which fits the data array
param: array        A set of parameters to pass through for the calling of the evaluation functions / call back function
param: 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.
param: [type]        $structurePath: ...
return: void

process_cmdmap()   X-Ref
Processing the cmd-array
See "TYPO3 Core API" for a description of the options.

return: void

copyRecord($table,$uid,$destPid,$first=0,$overrideValues=array()   X-Ref
Copying a single record

param: string        Element table
param: integer        Element UID
param: integer        $destPid: >=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
param: boolean        $first is a flag set, if the record copied is NOT a 'slave' to another record copied. That is, if this record was asked to be copied in the cmd-array
param: array        Associative array with field/value pairs to override directly. Notice; Fields must exist in the table record and NOT be among excluded fields!
param: string        Commalist of fields to exclude from the copy process (might get default values)
return: integer        ID of new record, if any

copyPages($uid,$destPid)   X-Ref
Copying pages
Main function for copying pages.

param: integer        Page UID to copy
param: 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
return: void

copySpecificPage($uid,$destPid,$copyTablesArray,$first=0)   X-Ref
Copying a single page ($uid) to $destPid and all tables in the array copyTablesArray.

param: integer        Page uid
param: 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
param: array        Table on pages to copy along with the page.
param: boolean        $first is a flag set, if the record copied is NOT a 'slave' to another record copied. That is, if this record was asked to be copied in the cmd-array
return: integer        The id of the new page, if applicable.

copyRecord_raw($table,$uid,$pid,$overrideArray=array()   X-Ref
Copying records, but makes a "raw" copy of a record.
Basically the only thing observed is field processing like the copying of files and correction of ids. All other fields are 1-1 copied.
Technically the copy is made with THIS instance of the tcemain class contrary to copyRecord() which creates a new instance and uses the processData() function.
The copy is created by insertNewCopyVersion() which bypasses most of the regular input checking associated with processData() - maybe copyRecord() should even do this as well!?
This function is used to create new versions of a record.
NOTICE: DOES NOT CHECK PERMISSIONS to create! And since page permissions are just passed through and not changed to the user who executes the copy we cannot enforce permissions without getting an incomplete copy - unless we change permissions of course.

param: string        Element table
param: integer        Element UID
param: integer        Element PID (real PID, not checked)
param: array        Override array - must NOT contain any fields not in the table!
return: integer        Returns the new ID of the record (if applicable)

rawCopyPageContent($old_pid,$new_pid,$copyTablesArray)   X-Ref
Copies all records from tables in $copyTablesArray from page with $old_pid to page with $new_pid
Uses raw-copy for the operation (meant for versioning!)

param: integer        Current page id.
param: integer        New page id
param: array        Array of tables from which to copy
return: void

insertNewCopyVersion($table,$fieldArray,$realPid)   X-Ref
Inserts a record in the database, passing TCA configuration values through checkValue() but otherwise does NOTHING and checks nothing regarding permissions.
Passes the "version" parameter to insertDB() so the copy will look like a new version in the log - should probably be changed or modified a bit for more broad usage...

param: string        Table name
param: array        Field array to insert as a record
param: integer        The value of PID field.  -1 is indication that we are creating a new version!
return: integer        Returns the new ID of the record (if applicable)

copyRecord_procBasedOnFieldType($table,$uid,$field,$value,$row,$conf,$realDestPid)   X-Ref
Processing/Preparing content for copyRecord() function

param: string        Table name
param: integer        Record uid
param: string        Field name being processed
param: string        Input value to be processed.
param: array        Record array
param: array        TCA field configuration
param: integer        Real page id (pid) the record is copied to
return: mixed        Processed value. Normally a string/integer, but can be an array for flexforms!

copyRecord_flexFormCallBack($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)   X-Ref
Callback function for traversing the FlexForm structure in relation to creating copied files of file relations inside of flex form structures.

param: array        Array of parameters in num-indexes: table, uid, field
param: array        TCA field configuration (from Data Structure XML)
param: string        The value of the flexForm field
param: string        Not used.
param: string        Not used.
return: array        Result array with key "value" containing the value of the processing.

copyRecord_procFilesRefs($conf, $uid, $value)   X-Ref
Modifying a field value for any situation regarding files/references:
For attached files: take current filenames and prepend absolute paths so they get copied.
For DB references: Nothing done.

param: array        TCE field config
param: integer        Record UID
param: string        Field value (eg. list of files)
return: string        The (possibly modified) value

moveRecord($table,$uid,$destPid)   X-Ref
Moving single records

param: string        Table name to move
param: integer        Record uid to move
param: integer        Position to move to: $destPid: >=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
return: void

moveRecord_procFields($table,$uid,$destPid)   X-Ref
Walk through all fields of the moved record and look for children of e.g. the inline type.
If child records are found, they are also move to the new $destPid.

param: string        $table: Record Table
param: string        $uid: Record UID
param: string        $destPid: Position to move to
return: [type]        ...

moveRecord_procBasedOnFieldType($table,$uid,$destPid,$field,$value,$conf)   X-Ref
Move child records depending on the field type of the parent record.

param: string        $table: Record Table
param: string        $uid: Record UID
param: string        $destPid: Position to move to
param: string        $field: Record field
param: string        $value: Record field value
param: array        $conf: TCA configuration on current field
return: [type]        ...

localize($table,$uid,$language)   X-Ref
Localizes a record to another system language
In reality it only works if transOrigPointerTable is not set. For "pages" the implementation is hardcoded

param: string        Table name
param: integer        Record uid (to be localized)
param: integer        Language ID (from sys_language table)
return: void

deleteAction($table, $id)   X-Ref
Delete a single record

param: string        Table name
param: integer        Record UID
return: void

deleteEl($table, $uid, $noRecordCheck=FALSE, $forceHardDelete=FALSE)   X-Ref
Delete element from any table

param: string        Table name
param: integer        Record UID
param: boolean        Flag: If $noRecordCheck is set, then the function does not check permission to delete record
param: boolean        If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
return: void

deleteVersionsForRecord($table, $uid, $forceHardDelete)   X-Ref
Delete versions for element from any table

param: string        Table name
param: integer        Record UID
param: boolean        If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
return: void

undeleteRecord($table,$uid)   X-Ref
Undelete a single record

param: string        Table name
param: integer        Record UID
return: void

deleteRecord($table,$uid, $noRecordCheck=FALSE, $forceHardDelete=FALSE,$undeleteRecord=FALSE)   X-Ref
Deleting/Undeleting a record
This function may not be used to delete pages-records unless the underlying records are already deleted
Deletes a record regardless of versioning state (live or offline, doesn't matter, the uid decides)
If both $noRecordCheck and $forceHardDelete are set it could even delete a "deleted"-flagged record!

param: string        Table name
param: integer        Record UID
param: boolean        Flag: If $noRecordCheck is set, then the function does not check permission to delete record
param: boolean        If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
param: boolean        If TRUE, the "deleted" flag is set to 0 again and thus, the item is undeleted.
return: void

deleteRecord_flexFormCallBack($dsArr, $dataValue, $PA, $structurePath, &$pObj)   X-Ref
Call back function for deleting file relations for flexform fields in records which are being completely deleted.

param: [type]        $dsArr: ...
param: [type]        $dataValue: ...
param: [type]        $PA: ...
param: [type]        $structurePath: ...
param: [type]        $pObj: ...
return: [type]        ...

deletePages($uid,$force=FALSE,$forceHardDelete=FALSE)   X-Ref
Used to delete page because it will check for branch below pages and unallowed tables on the page as well.

param: integer        Page id
param: boolean        If TRUE, pages are not checked for permission.
param: boolean        If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
return: void

deleteSpecificPage($uid,$forceHardDelete=FALSE)   X-Ref
Delete a page and all records on it.

param: integer        Page id
param: boolean        If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
return: void

canDeletePage($uid)   X-Ref
Used to evaluate if a page can be deleted

param: integer        Page id
return: mixed        If array: List of page uids to traverse and delete (means OK), if string: error code.

cannotDeleteRecord($table,$id)   X-Ref
Returns true if record CANNOT be deleted, otherwise false. Used to check before the versioning API allows a record to be marked for deletion.

param: string        Record Table
param: integer        Record UID
return: string        Returns a string IF there is an error (error string explaining). FALSE means record can be deleted

deleteRecord_procFields($table, $uid, $undeleteRecord = false)   X-Ref
Beford a record is deleted, check if it has references such as inline type or MM references.
If so, set these child records also to be deleted.

param: string        $table: Record Table
param: string        $uid: Record UID
param: boolean        $undeleteRecord: If a record should be undeleted (e.g. from history/undo)
return: void

deleteRecord_procBasedOnFieldType($table, $uid, $field, $value, $conf, $undeleteRecord = false)   X-Ref
Process fields of a record to be deleted and search for special handling, like
inline type, MM records, etc.

param: string        $table: Record Table
param: string        $uid: Record UID
param: string        $field: Record field
param: string        $value: Record field value
param: array        $conf: TCA configuration on current field
param: boolean        $undeleteRecord: If a record should be undeleted (e.g. from history/undo)
return: void

versionizeRecord($table,$id,$label,$delete=FALSE,$versionizeTree=-1)   X-Ref
Creates a new version of a record
(Requires support in the table)

param: string        Table name
param: integer        Record uid to versionize
param: string        Version label
param: boolean        If true, the version is created to delete the record.
param: integer        Indicating "treeLevel" - or versioning type - "element" (-1), "page" (0) or "branch" (>=1)
return: integer        Returns the id of the new version (if any)

versionizePages($uid,$label,$versionizeTree)   X-Ref
Creates a new version of a page including content and possible subpages.

param: integer        Page uid to create new version of.
param: string        Version label
param: integer        Indicating "treeLevel" - "page" (0) or "branch" (>=1) ["element" type must call versionizeRecord() directly]
return: void

version_swap($table,$id,$swapWith,$swapIntoWS=0)   X-Ref
Swapping versions of a record
Version from archive (future/past, called "swap version") will get the uid of the "t3ver_oid", the official element with uid = "t3ver_oid" will get the new versions old uid. PIDs are swapped also

param: string        Table name
param: integer        UID of the online record to swap
param: integer        UID of the archived version to swap with!
param: boolean        If set, swaps online into workspace instead of publishing out of workspace.
return: void

version_clearWSID($table,$id)   X-Ref
Release version from this workspace (and into "Live" workspace but as an offline version).

param: string        Table name
param: integer        Record UID
return: void

version_setStage($table,$id,$stageId,$comment='')   X-Ref
Setting stage of record

param: string        Table name
param: integer        Record UID
param: integer        Stage ID to set
param: string        Comment that goes into log
return: void

remapListedDBRecords()   X-Ref
Processes the fields with references as registered during the copy process. This includes all FlexForm fields which had references.

return: void

remapListedDBRecords_flexFormCallBack($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2)   X-Ref
Callback function for traversing the FlexForm structure in relation to creating copied files of file relations inside of flex form structures.

param: array        Set of parameters in numeric array: table, uid, field
param: array        TCA config for field (from Data Structure of course)
param: string        Field value (from FlexForm XML)
param: string        Not used
param: string        Not used
return: array        Array where the "value" key carries the value.

remapListedDBRecords_procDBRefs($conf, $value, $MM_localUid, $table)   X-Ref
Performs remapping of old UID values to NEW uid values for a DB reference field.

param: array        TCA field config
param: string        Field value
param: integer        UID of local record (for MM relations - might need to change if support for FlexForms should be done!)
param: string        Table name
return: array        Returns array of items ready to implode for field content.

remapListedDBRecords_procInline($conf, $value, $uid, $table)   X-Ref
Performs remapping of old UID values to NEW uid values for a inline field.

param: array        $conf: TCA field config
param: string        $value: Field value
param: integer        $uid: The uid of the ORIGINAL record
param: string        $table: Table name
return: void

processRemapStack()   X-Ref
Processes the $this->remapStack at the end of copying, inserting, etc. actions.
The remapStack takes care about the correct mapping of new and old uids in case of relational data.

return: void

checkModifyAccessList($table)   X-Ref
Checking group modify_table access list

param: string        Table name
return: boolean        Returns true if the user has general access to modify the $table

isRecordInWebMount($table,$id)   X-Ref
Checking if a record with uid $id from $table is in the BE_USERS webmounts which is required for editing etc.

param: string        Table name
param: integer        UID of record
return: boolean        Returns true if OK. Cached results.

isInWebMount($pid)   X-Ref
Checks if the input page ID is in the BE_USER webmounts

param: integer        Page ID to check
return: boolean        True if OK. Cached results.

checkRecordUpdateAccess($table,$id)   X-Ref
Checks if user may update a record with uid=$id from $table

param: string        Record table
param: integer        Record UID
return: boolean        Returns true if the user may update the record given by $table and $id

checkRecordInsertAccess($insertTable,$pid,$action=1)   X-Ref
Checks if user may insert a record from $insertTable on $pid
Does not check for workspace, use BE_USER->workspaceAllowLiveRecordsInPID for this in addition to this function call.

param: string        Tablename to check
param: integer        Integer PID
param: integer        For logging: Action number.
return: boolean        Returns true if the user may insert a record from table $insertTable on page $pid

isTableAllowedForThisPage($page_uid, $checkTable)   X-Ref
Checks if a table is allowed on a certain page id according to allowed tables set for the page "doktype" and its [ctrl][rootLevel]-settings if any.

param: integer        Page id for which to check, including 0 (zero) if checking for page tree root.
param: string        Table name to check
return: boolean        True if OK

doesRecordExist($table,$id,$perms)   X-Ref
Checks if record can be selected based on given permission criteria

param: string        Record table name
param: integer        Record UID
param: mixed        Permission restrictions to observe: Either an integer that will be bitwise AND'ed or a string, which points to a key in the ->pMap array
return: boolean        Returns true if the record given by $table, $id and $perms can be selected

doesRecordExist_pageLookUp($id, $perms)   X-Ref
Looks up a page based on permissions.

param: integer        Page id
param: integer        Permission integer
return: pointer        MySQL result pointer (from exec_SELECTquery())

doesBranchExist($inList,$pid,$perms,$recurse)   X-Ref
Checks if a whole branch of pages exists

Tests the branch under $pid (like doesRecordExist). It doesn't test the page with $pid as uid. Use doesRecordExist() for this purpose
Returns an ID-list or "" if OK. Else -1 which means that somewhere there was no permission (eg. to delete).
if $recurse is set, then the function will follow subpages. This MUST be set, if we need the idlist for deleting pages or else we get an incomplete list

param: string        List of page uids, this is added to and outputted in the end
param: integer        Page ID to select subpages from.
param: integer        Perms integer to check each page record for.
param: boolean        Recursion flag: If set, it will go out through the branch.
return: string        List of integers in branch

tableReadOnly($table)   X-Ref
Checks if the $table is readOnly

param: string        Table name
return: boolean        True, if readonly

tableAdminOnly($table)   X-Ref
Checks if the $table is only editable by admin-users

param: string        Table name
return: boolean        True, if readonly

destNotInsideSelf($dest,$id)   X-Ref
Checks if piage $id is a uid in the rootline from page id, $dest
Used when moving a page

param: integer        Destination Page ID to test
param: integer        Page ID to test for presence inside Destination
return: boolean        Returns false if ID is inside destination (including equal to)

getExcludeListArray()   X-Ref
Generate an array of fields to be excluded from editing for the user. Based on "exclude"-field in TCA and a look up in non_exclude_fields
Will also generate this list for admin-users so they must be check for before calling the function

return: array        Array of [table]-[field] pairs to exclude from editing.

doesPageHaveUnallowedTables($page_uid,$doktype)   X-Ref
Checks if there are records on a page from tables that are not allowed

param: integer        Page ID
param: integer        Page doktype
return: array        Returns a list of the tables that are 'present' on the page but not allowed with the page_uid/doktype

pageInfo($id,$field)   X-Ref
Returns the value of the $field from page $id
NOTICE; the function caches the result for faster delivery next time. You can use this function repeatedly without performanceloss since it doesn't look up the same record twice!

param: integer        Page uid
param: string        Field name for which to return value
return: string        Value of the field. Result is cached in $this->pageCache[$id][$field] and returned from there next time!

recordInfo($table,$id,$fieldList)   X-Ref
Returns the row of a record given by $table and $id and $fieldList (list of fields, may be '*')
NOTICE: No check for deleted or access!

param: string        Table name
param: integer        UID of the record from $table
param: string        Field list for the SELECT query, eg. "*" or "uid,pid,..."
return: mixed        Returns the selected record on success, otherwise false.

getRecordProperties($table,$id,$noWSOL=FALSE)   X-Ref
Returns an array with record properties, like header and pid
No check for deleted or access is done!
For versionized records, pid is resolved to its live versions pid.
Used for loggin

param: string        Table name
param: integer        Uid of record
param: boolean        If set, no workspace overlay is performed
return: array        Properties of record

getRecordPropertiesFromRow($table,$row)   X-Ref
Returns an array with record properties, like header and pid, based on the row

param: string        Table name
param: array        Input row
return: array        Output array

updateDB($table,$id,$fieldArray)   X-Ref
Update database record
Does not check permissions but expects them to be verified on beforehand

param: string        Record table name
param: integer        Record uid
param: array        Array of field=>value pairs to insert. FIELDS MUST MATCH the database FIELDS. No check is done.
return: void

insertDB($table,$id,$fieldArray,$newVersion=FALSE,$suggestedUid=0,$dontSetNewIdIndex=FALSE)   X-Ref
Insert into database
Does not check permissions but expects them to be verified on beforehand

param: string        Record table name
param: string        "NEW...." uid string
param: array        Array of field=>value pairs to insert. FIELDS MUST MATCH the database FIELDS. No check is done. "pid" must point to the destination of the record!
param: boolean        Set to true if new version is created.
param: integer        Suggested UID value for the inserted record. See the array $this->suggestedInsertUids; Admin-only feature
param: boolean        If true, the ->substNEWwithIDs array is not updated. Only useful in very rare circumstances!
return: integer        Returns ID on success.

checkStoredRecord($table,$id,$fieldArray,$action)   X-Ref
Checking stored record to see if the written values are properly updated.

param: string        Record table name
param: integer        Record uid
param: array        Array of field=>value pairs to insert/update
param: string        Action, for logging only.
return: array        Selected row

setHistory($table,$id,$logId)   X-Ref
Setting sys_history record, based on content previously set in $this->historyRecords[$table.':'.$id] (by compareFieldArrayWithCurrentAndUnset())

param: string        Table name
param: integer        Record ID
param: integer        Log entry ID, important for linking between log and history views
return: void

clearHistory($maxAgeSeconds=604800,$table)   X-Ref
Clearing sys_history table from older entries that are expired.

param: integer        $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.
param: string        table where the history should be cleared
return: void

updateRefIndex($table,$id)   X-Ref
Update Reference Index (sys_refindex) for a record
Should be called any almost any update to a record which could affect references inside the record.

param: string        Table name
param: integer        Record UID
return: void

getSortNumber($table,$uid,$pid)   X-Ref
Returning sorting number for tables with a "sortby" column
Using when new records are created and existing records are moved around.

param: string        Table name
param: integer        Uid of record to find sorting number for. May be zero in case of new.
param: integer        Positioning PID, either >=0 (pointing to page in which case we find sorting number for first record in page) or <0 (pointing to record in which case to find next sorting number after this record)
return: mixed        Returns integer if PID is >=0, otherwise an array with PID and sorting number. Possibly false in case of error.

resorting($table,$pid,$sortRow, $return_SortNumber_After_This_Uid)   X-Ref
Resorts a table.
Used internally by getSortNumber()

param: string        Table name
param: integer        Pid in which to resort records.
param: string        Sorting row
param: integer        Uid of record from $table in this $pid and for which the return value will be set to a free sorting number after that record. This is used to return a sortingValue if the list is resorted because of inserting records inside the list and not in the top
return: integer        If $return_SortNumber_After_This_Uid is set, will contain usable sorting number after that record if found (otherwise 0)

setTSconfigPermissions($fieldArray,$TSConfig_p)   X-Ref
Setting up perms_* fields in $fieldArray based on TSconfig input
Used for new pages

param: array        Field Array, returned with modifications
param: array        TSconfig properties
return: array        Modified Field Array

newFieldArray($table)   X-Ref
Returns a fieldArray with default values. Values will be picked up from the TCA array looking at the config key "default" for each column. If values are set in ->defaultValues they will overrule though.
Used for new records and during copy operations for defaults

param: string        Table name for which to set default values.
return: array        Array with default values.

addDefaultPermittedLanguageIfNotSet($table,&$incomingFieldArray)   X-Ref
If a "languageField" is specified for $table this function will add a possible value to the incoming array if none is found in there already.

param: string        Table name
param: array        Incoming array (passed by reference)
return: void

overrideFieldArray($table,$data)   X-Ref
Returns the $data array from $table overridden in the fields defined in ->overrideValues.

param: string        Table name
param: array        Data array with fields from table. These will be overlaid with values in $this->overrideValues[$table]
return: array        Data array, processed.

compareFieldArrayWithCurrentAndUnset($table,$id,$fieldArray)   X-Ref
Compares the incoming field array with the current record and unsets all fields which are the same.
Used for existing records being updated

param: string        Record table name
param: integer        Record uid
param: 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!
return: array        Returns $fieldArray. If the returned array is empty, then the record should not be updated!

assemblePermissions($string)   X-Ref
Calculates the bitvalue of the permissions given in a string, comma-sep

param: string        List of pMap strings
return: integer        Integer mask

rmComma($input)   X-Ref
Returns the $input string without a comma in the end

param: string        Input string
return: string        Output string with any comma in the end removed, if any.

convNumEntityToByteValue($input)   X-Ref
Converts a HTML entity (like &#123;) to the character '123'

param: string        Input string
return: string        Output string

destPathFromUploadFolder($folder)   X-Ref
Returns absolute destination path for the uploadfolder, $folder

param: string        Upload folder name, relative to PATH_site
return: string        Input string prefixed with PATH_site

deleteClause($table)   X-Ref
Returns delete-clause for the $table

param: string        Table name
return: string        Delete clause

getTCEMAIN_TSconfig($tscPID)   X-Ref
Return TSconfig for a page id

param: integer        Page id (PID) from which to get configuration.
return: array        TSconfig array, if any

getTableEntries($table,$TSconfig)   X-Ref
Extract entries from TSconfig for a specific table. This will merge specific and default configuration together.

param: string        Table name
param: array        TSconfig for page
return: array        TSconfig merged

getPID($table,$uid)   X-Ref
Returns the pid of a record from $table with $uid

param: string        Table name
param: integer        Record uid
return: integer        PID value (unless the record did not exist in which case FALSE)

dbAnalysisStoreExec()   X-Ref
Executing dbAnalysisStore
This will save MM relations for new records but is executed after records are created because we need to know the ID of them

return: void

removeRegisteredFiles()   X-Ref
Removing files registered for removal before exit

return: void

removeCacheFiles()   X-Ref
Unlink (delete) typo3conf/temp_CACHED_*.php cache files

return: integer        The number of files deleted

int_pageTreeInfo($CPtable,$pid,$counter, $rootID)   X-Ref
Returns array, $CPtable, of pages under the $pid going down to $counter levels.
Selecting ONLY pages which the user has read-access to!

param: array        Accumulation of page uid=>pid pairs in branch of $pid
param: integer        Page ID for which to find subpages
param: integer        Number of levels to go down.
param: integer        ID of root point for new copied branch: The idea seems to be that a copy is not made of the already new page!
return: array        Return array.

compileAdminTables()   X-Ref
List of all tables (those administrators has access to = array_keys of $TCA)

return: array        Array of all TCA table names

fixUniqueInPid($table,$uid)   X-Ref
Checks if any uniqueInPid eval input fields are in the record and if so, they are re-written to be correct.

param: string        Table name
param: integer        Record UID
return: void

fixCopyAfterDuplFields($table,$uid,$prevUid,$update, $newData=array()   X-Ref
When er record is copied you can specify fields from the previous record which should be copied into the new one
This function is also called with new elements. But then $update must be set to zero and $newData containing the data array. In that case data in the incoming array is NOT overridden. (250202)

param: string        Table name
param: integer        Record UID
param: integer        UID of previous record
param: boolean        If set, updates the record
param: array        Input array. If fields are already specified AND $update is not set, values are not set in output array.
return: array        Output array (For when the copying operation needs to get the information instead of updating the info)

extFileFields($table)   X-Ref
Returns all fieldnames from a table which are a list of files

param: string        Table name
return: array        Array of fieldnames that are either "group" or "file" types.

getUniqueFields($table)   X-Ref
Returns all fieldnames from a table which have the unique evaluation type set.

param: string        Table name
return: array        Array of fieldnames

isReferenceField($conf)   X-Ref
Returns true if the TCA/columns field type is a DB reference field

param: array        config array for TCA/columns field
return: boolean        True if DB reference field (group/db or select with foreign-table)

getInlineFieldType($conf)   X-Ref
Returns the subtype as a string of an inline field.
If it's not a inline field at all, it returns false.

param: array        config array for TCA/columns field
return: mixed        string: inline subtype (field|mm|list), boolean: false

getCopyHeader($table,$pid,$field,$value,$count,$prevTitle='')   X-Ref
Get modified header for a copied record

param: string        Table name
param: integer        PID value in which other records to test might be
param: string        Field name to get header value for.
param: string        Current field value
param: integer        Counter (number of recursions)
param: string        Previous title we checked for (in previous recursion)
return: string        The field value, possibly appended with a "copy label"

prependLabel($table)   X-Ref
Return "copy" label for a table. Although the name is "prepend" it actually APPENDs the label (after ...)

param: string        Table name
return: string        Label to append, containing "%s" for the number

resolvePid($table,$pid)   X-Ref
Get the final pid based on $table and $pid ($destPid type... pos/neg)

param: string        Table name
param: integer        "Destination pid" : If the value is >= 0 it's just returned directly (through intval() though) but if the value is <0 then the method looks up the record with the uid equal to abs($pid) (positive number) and returns the PID of that record! The idea is that negative numbers point to the record AFTER WHICH the position is supposed to be!
return: integer

clearPrefixFromValue($table,$value)   X-Ref
Removes the prependAtCopy prefix on values

param: string        Table name
param: string        The value to fix
return: string        Clean name

extFileFunctions($table,$field,$filelist,$func)   X-Ref
File functions on external file references. eg. deleting files when deleting record

param: string        Table name
param: string        Field name
param: string        List of files to work on from field
param: string        Function, eg. "deleteAll" which will delete all files listed.
return: void

noRecordsFromUnallowedTables($inList)   X-Ref
Used by the deleteFunctions to check if there are records from disallowed tables under the pages to be deleted.

param: string        List of page integers
return: boolean        Return true, if permission granted

notifyStageChange($stat,$stageId,$table,$id,$comment)   X-Ref
Send an email notification to users in workspace

param: array        Workspace access array (from t3lib_userauthgroup::checkWorkspace())
param: integer        New Stage number: 0 = editing, 1= just ready for review, 10 = ready for publication, -1 = rejected!
param: string        Table name of element
param: integer        Record uid of element
param: string        User comment sent along with action
return: void

notifyStageChange_getEmails($listOfUsers,$noTablePrefix=FALSE)   X-Ref
Return emails addresses of be_users from input list.

param: string        List of backend users, on the form "be_users_10,be_users_2" or "10,2" in case noTablePrefix is set.
param: boolean        If set, the input list are integers and not strings.
return: array        Array of emails

isRecordCopied($table, $uid)   X-Ref
Determine if a record was copied or if a record is the result of a copy action.

param: string        $table: The tablename of the record
param: integer        $uid: The uid of the record
return: boolean        Returns true if the record is copied or is the result of a copy action

clear_cache($table,$uid)   X-Ref
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.

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

clear_cacheCmd($cacheCmd)   X-Ref
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())

param: string        The cache comment, see above description.
return: void

log($table,$recuid,$action,$recpid,$error,$details,$details_nr=-1,$data=array()   X-Ref
Logging actions from TCEmain

param: string        Table name the log entry is concerned with. Blank if NA
param: integer        Record UID. Zero if NA
param: integer        Action number: 0=No category, 1=new record, 2=update record, 3= delete record, 4= move record, 5= Check/evaluate
param: integer        Normally 0 (zero). If set, it indicates that this log-entry is used to notify the backend of a record which is moved to another location
param: integer        The severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
param: string        Default error message in english
param: integer        This number is unique for every combination of $type and $action. This is the error-message number, which can later be used to translate error messages. 0 if not categorized, -1 if temporary
param: array        Array with special information that may go into $details by '%s' marks / sprintf() when the log is shown
param: integer        The page_uid (pid) where the event occurred. Used to select log-content for specific pages.
param: string        NEW id for new records
return: integer        Log entry UID

newlog($message, $error=0)   X-Ref
Simple logging function meant to be used when logging messages is not yet fixed.

param: string        Message string
param: integer        Error code, see log()
return: integer        Log entry UID

printLogErrorMessages($redirect)   X-Ref
Print log error messages from the operations of this script instance

param: string        Redirect URL (for creating link in message)
return: void        (Will exit on error)

internal_clearPageCache()   X-Ref
Clears page cache. Takes into account file cache.

return: void



Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics