[ 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_transferdata.php (sommaire)

Contains class for getting and transforming data for display in backend forms (TCEforms) $Id: class.t3lib_transferdata.php 2404 2007-07-13 15:44:21Z mundaun $ Revised for TYPO3 3.6 September/2003 by Kasper Skaarhoj

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

Définit 1 class

t3lib_transferData:: (20 méthodes):
  fetchRecord()
  renderRecord()
  renderRecordRaw()
  renderRecord_SW()
  renderRecord_groupProc()
  renderRecord_selectProc()
  renderRecord_flexProc()
  renderRecord_typesProc()
  renderRecord_inlineProc()
  renderRecord_flexProc_procInData()
  renderRecord_flexProc_procInData_travDS()
  selectAddSpecial()
  selectAddForeign()
  getDataIdList()
  procesItemArray()
  addItems()
  procItems()
  lockRecord()
  regItem()
  sL()


Classe: t3lib_transferData  - X-Ref

Class for getting and transforming data for display in backend forms (TCEforms)

fetchRecord($table,$idList,$operation)   X-Ref
A function which can be used for load a batch of records from $table into internal memory of this object.
The function is also used to produce proper default data for new records
Ultimately the function will call renderRecord()

param: string        Table name, must be found in $TCA
param: string        Comma list of id values. If $idList is "prev" then the value from $this->prevPageID is used. NOTICE: If $operation is "new", then negative ids are meant to point to a "previous" record and positive ids are PID values for new records. Otherwise (for existing records that is) it is straight forward table/id pairs.
param: string        If "new", then a record with default data is returned. Further, the $id values are meant to be PID values (or if negative, pointing to a previous record). If NOT new, then the table/ids are just pointing to an existing record!
return: void

renderRecord($table, $id, $pid, $row)   X-Ref
This function performs processing on the input $row array and stores internally a corresponding array which contains processed values, ready to pass on to the TCEforms rendering in the frontend!
The objective with this function is to prepare the content for handling in TCEforms.
Default values from outside/TSconfig is added by fetchRecord(). In this function default values from TCA is used if a field is NOT defined in $row.
The resulting, processed row is stored in $this->regTableItems_data[$uniqueItemRef], where $uniqueItemRef is "[tablename]_[id-value]"

param: string        The table name
param: string        The uid value of the record (integer). Can also be a string (NEW-something) if the record is a NEW record.
param: integer        The pid integer. For existing records this is of course the row's "pid" field. For new records it can be either a page id (positive) or a pointer to another record from the SAME table (negative) after which the record should be inserted (or on same page)
param: array        The row of the current record. If NEW record, then it may be loaded with default values (by eg. fetchRecord()).
return: void

renderRecordRaw($table, $id, $pid, $row, $TSconfig='', $tscPID=0)   X-Ref
This function performs processing on the input $row array and stores internally a corresponding array which contains processed values, ready to pass on to the TCEforms rendering in the frontend!
The objective with this function is to prepare the content for handling in TCEforms.
In opposite to renderRecord() this function do not prepare things like fetching TSconfig and others.
The resulting, processed row will be returned.

param: string        The table name
param: string        The uid value of the record (integer). Can also be a string (NEW-something) if the record is a NEW record.
param: integer        The pid integer. For existing records this is of course the row's "pid" field. For new records it can be either a page id (positive) or a pointer to another record from the SAME table (negative) after which the record should be inserted (or on same page)
param: array        The row of the current record. If NEW record, then it may be loaded with default values (by eg. fetchRecord()).
param: array        Tsconfig array
param: integer        PAGE TSconfig pid
return: array        Processed record data

renderRecord_SW($data,$fieldConfig,$TSconfig,$table,$row,$field)   X-Ref
Function with the switch() construct which triggers functions for processing of the data value depending on the TCA-config field type.

param: string        Value to process
param: array        TCA/columns array for field    (independant of TCA for flexforms - coming from XML then)
param: array        TSconfig    (blank for flexforms for now)
param: string        Table name
param: array        The row array, always of the real record (also for flexforms)
param: string        The field (empty for flexforms!)
return: string        Modified $value

renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)   X-Ref
Processing of the data value in case the field type is "group"

param: string        The field value
param: array        TCA field config
param: array        TCEform TSconfig for the record
param: string        Table name
param: array        The row
param: string        Field name
return: string        The processed input field value ($data)

renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)   X-Ref
Processing of the data value in case the field type is "select"

param: string        The field value
param: array        TCA field config
param: array        TCEform TSconfig for the record
param: string        Table name
param: array        The row
param: string        Field name
return: string        The processed input field value ($data)

renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)   X-Ref
Processing of the data value in case the field type is "flex"
MUST NOT be called in case of already INSIDE a flexform!

param: string        The field value
param: array        TCA field config
param: array        TCEform TSconfig for the record
param: string        Table name
param: array        The row
param: string        Field name
return: string        The processed input field value ($data)

renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)   X-Ref
Processing of the content in $totalRecordcontent based on settings in the types-configuration

param: array        The array of values which has been processed according to their type (eg. "group" or "select")
param: array        The "types" configuration for the current display of fields.
param: integer        PAGE TSconfig PID
param: string        Table name
param: integer        PID value
return: array        The processed version of $totalRecordContent

renderRecord_inlineProc($data,$fieldConfig,$TSconfig,$table,$row,$field)   X-Ref
Processing of the data value in case the field type is "inline"
In some parts nearly the same as type "select"

param: string        The field value
param: array        TCA field config
param: array        TCEform TSconfig for the record
param: string        Table name
param: array        The row
param: string        Field name
return: string        The processed input field value ($data)

renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)   X-Ref
Function traversing sheets/languages for flex form data structures

param: array        Data array
param: array        Data Structure array
param: array        Various parameters to pass-through
return: array        Modified $dataPart array.

renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams)   X-Ref
Traverse data array / structure

param: array        Data array passed by reference.
param: array        Data structure
param: array        Various parameters pass-through.
return: void

selectAddSpecial($dataAcc, $elements, $specialKey)   X-Ref
Adding "special" types to the $dataAcc array of selector items

param: array        Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
param: array        The array of original elements - basically the field value exploded by ","
param: string        The "special" key from the TCA config of the field. Determines the type of processing in here.
return: array        Modified $dataAcc array

selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row, $table)   X-Ref
Adds the foreign record elements to $dataAcc, if any

param: array        Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
param: array        The array of original elements - basically the field value exploded by ","
param: array        Field configuration from TCA
param: string        The field name
param: array        TSconfig for the record
param: array        The record
param: array        The current table
return: array        Modified $dataAcc array

getDataIdList($elements, $fieldConfig, $row, $table)   X-Ref
Returning the id-list processed by loadDBgroup for the foreign tables.

param: array        The array of original elements - basically the field value exploded by ","
param: array        Field configuration from TCA
param: array        The data array, currently. Used to set the "local_uid" for selecting MM relation records.
param: string        Current table name. passed on to t3lib_loadDBGroup
return: array        An array with ids of the records from the input elements array.

procesItemArray($selItems,$config,$fieldTSConfig,$table,$row,$field)   X-Ref
Processing of selector box items. This includes the automated adding of elements plus user-function processing.

param: array        The elements to process
param: array        TCA/columns configuration
param: array        TSconfig for the field
param: string        The table name
param: array        The current row
param: string        The field name
return: array        The modified input $selItems array

addItems($items,$iArray)   X-Ref
Adding items from $iArray to $items array

param: array        The array of selector box items to which key(value) / value(label) pairs from $iArray will be added.
param: array        The array of elements to add. The keys will become values. The value will become the label.
return: array        The modified input $items array

procItems($items,$itemsProcFuncTSconfig,$config,$table,$row,$field)   X-Ref
User processing of a selector box array of values.

param: array        The array of selector box items
param: array        TSconfig for the fields itemProcFunc
param: array        TCA/columns configuration
param: string        The table name
param: array        The current row
param: string        The field name
return: array        The modified input $items array

lockRecord($table, $id, $pid=0)   X-Ref
Sets the lock for a record from table/id, IF $this->lockRecords is set!

param: string        The table name
param: integer        The id of the record
param: integer        The pid of the record
return: void

regItem($table, $id, $field, $content)   X-Ref
Dummy function, can be used to "register" records. Used by eg. the "show_item" script.

param: string        Table name
param: integer        Record id
param: string        Field name
param: string        Field content.
return: void

sL($in)   X-Ref
Local wrapper function for LANG->sL (returning language labels)

param: string        Language label key
return: string        Localized label value.



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