Solutions Open Source

Référence de la classe t3lib_TCEforms_inline

Liste de tous les membres

Fonctions membres publiques

 init (&$tceForms)
 getSingleField_typeInline ($table, $field, $row, &$PA)
 renderForeignRecord ($parentUid, $rec, $config=array())
 renderForeignRecordHeader ($parentUid, $foreign_table, $rec, $config=array())
 renderForeignRecordHeaderControl ($parentUid, $foreign_table, $rec, $config=array())
 renderCombinationTable (&$rec, $appendFormFieldNames, $config=array())
 renderPossibleRecordsSelector ($selItems, $conf, $uniqueIds=array())
 renderPossibleRecordsSelectorTypeSelect ($selItems, $conf, &$PA, $uniqueIds=array())
 renderPossibleRecordsSelectorTypeGroupDB ($conf, &$PA)
 getNewRecordLink ($objectPrefix, $conf=array())
 addJavaScriptSortable ($objectId)
 initForAJAX ($method, &$arguments)
 createNewRecord ($domObjectId, $foreignUid=0)
 setExpandedCollapsedState ($domObjectId, $expand, $collapse)
 getRelatedRecords ($table, $field, $row, &$PA, $config)
 getPossibleRecords ($table, $field, $row, $conf, $checkForConfField='foreign_selector')
 getUniqueIds ($records, $conf=array(), $splitValue=false)
 getRecord ($pid, $table, $uid, $cmd='')
 getNewRecord ($pid, $table)
 pushStructure ($table, $uid, $field= '', $config=array())
 popStructure ()
 updateStructureNames ()
 getStructureItemName ($levelData)
 getStructureLevel ($level)
 getStructurePath ($structureDepth=-1)
 parseStructureString ($string, $loadConfig=false)
 checkConfiguration (&$config)
 checkAccess ($cmd, $table, $theUid)
 compareStructureConfiguration ($compare)
 normalizeUid ($string)
 wrapFormsSection ($section, $styleAttrs=array(), $tableAttrs=array())
 isInlineChildAndLabelField ($table, $field)
 getStructureDepth ()
 arrayCompareComplex ($subjectArray, $searchArray, $type= '')
 isAssociativeArray ($object)
 removeFromArray ($needle, $haystack, $strict=null)
 getPossibleRecordsFlat ($possibleRecords)
 getPossibleRecordsSelectorConfig ($conf, $field= '')
 getPossibleRecordsSelectorType ($config)
 skipField ($table, $field, $row, $config)
 getJSON ($jsonArray)
 getExpandedCollapsedState ($table, $uid)
 updateInlineView (&$uc, &$tce)
 getLevelMargin ()

Attributs publics

 $fObj
 $backPath
 $isAjaxCall = false
 $inlineStructure = array()
 $inlineFirstPid
 $inlineNames = array()
 $inlineData = array()
 $inlineView = array()
 $inlineCount = 0
 $inlineStyles = array()
 $prependNaming = 'data'
 $prependFormFieldNames
 $prependCmdFieldNames


Description détaillée

The Inline-Relational-Record-Editing (IRRE) functions as part of the TCEforms.

Id

Auteur:
Oliver Hader <oh@inpublica.de> [CLASS/FUNCTION INDEX of SCRIPT]
88: class t3lib_TCEforms_inline 109: function init(&$tceForms) 127: function getSingleField_typeInline($table,$field,$row,&$PA)

SECTION: Regular rendering of forms, fields, etc. 263: function renderForeignRecord($parentUid, $rec, $config = array()) 319: function renderForeignRecordHeader($parentUid, $foreign_table,$rec,$config = array()) 375: function renderForeignRecordHeaderControl($table,$row,$config = array()) 506: function renderCombinationTable(&$rec, $appendFormFieldNames, $config = array()) 560: function renderPossibleRecordsSelector($selItems, $conf, $uniqueIds=array()) 627: function addJavaScript() 643: function addJavaScriptSortable($objectId)

SECTION: Handling of AJAX calls 665: function createNewRecord($domObjectId, $foreignUid = 0) 755: function getJSON($jsonArray) 770: function getNewRecordLink($objectPrefix, $conf = array())

SECTION: Get data from database and handle relations 807: function getRelatedRecords($table,$field,$row,&$PA,$config) 839: function getPossibleRecords($table,$field,$row,$conf,$checkForConfField='foreign_selector') 885: function getUniqueIds($records, $conf=array()) 905: function getRecord($pid, $table, $uid, $cmd='') 929: function getNewRecord($pid, $table)

SECTION: Structure stack for handling inline objects/levels 951: function pushStructure($table, $uid, $field = '', $config = array()) 967: function popStructure() 984: function updateStructureNames() 1000: function getStructureItemName($levelData) 1015: function getStructureLevel($level) 1032: function getStructurePath($structureDepth = -1) 1057: function parseStructureString($string, $loadConfig = false)

SECTION: Helper functions 1098: function checkConfiguration(&$config) 1123: function checkAccess($cmd, $table, $theUid) 1185: function compareStructureConfiguration($compare) 1199: function normalizeUid($string) 1213: function wrapFormsSection($section, $styleAttrs = array(), $tableAttrs = array()) 1242: function isInlineChildAndLabelField($table, $field) 1258: function getStructureDepth() 1295: function arrayCompareComplex($subjectArray, $searchArray, $type = '') 1349: function isAssociativeArray($object) 1364: function getPossibleRecordsFlat($possibleRecords) 1383: function skipField($table, $field, $row, $config)

TOTAL FUNCTIONS: 35 (This index is automatically created/updated by the extension "extdeveval")


Documentation des fonctions membres

t3lib_TCEforms_inline::init ( &$  tceForms  ) 

Intialize an instance of t3lib_TCEforms_inline

Paramètres:
object $tceForms: Reference to an TCEforms instance
Renvoie:
void

t3lib_TCEforms_inline::getSingleField_typeInline ( table,
field,
row,
&$  PA 
)

Generation of TCEform elements of the type "inline" This will render inline-relational-record sets. Relations.

Paramètres:
string $table: The table name of the record
string $field: The field name which this element is supposed to edit
array $row: The record data array where the value(s) for the field can be found
array $PA: An array with additional configuration options.
Renvoie:
string The HTML code for the TCEform field

t3lib_TCEforms_inline::renderForeignRecord ( parentUid,
rec,
config = array() 
)

Render the form-fields of a related (foreign) record.

Paramètres:
string $parentUid: The uid of the parent (embedding) record (uid or NEW...)
array $rec: The table record of the child/embedded table (normaly post-processed by t3lib_transferData)
array 
config
PA['fieldConf']['config']
Renvoie:
string The HTML code for this "foreign record"

t3lib_TCEforms_inline::renderForeignRecordHeader ( parentUid,
foreign_table,
rec,
config = array() 
)

Renders the HTML header for a foreign record, such as the title, toggle-function, drag'n'drop, etc. Later on the command-icons are inserted here.

Paramètres:
string $parentUid: The uid of the parent (embedding) record (uid or NEW...)
string $foreign_table: The foreign_table we create a header for
array $rec: The current record of that foreign_table
array 
config
PA['fieldConf']['config']
Renvoie:
string The HTML code of the header

t3lib_TCEforms_inline::renderForeignRecordHeaderControl ( parentUid,
foreign_table,
rec,
config = array() 
)

Render the control-icons for a record header (create new, sorting, delete, disable/enable). Most of the parts are copy&paste from class.db_list_extra.inc and modified for the JavaScript calls here

Paramètres:
string $parentUid: The uid of the parent (embedding) record (uid or NEW...)
string $foreign_table: The table (foreign_table) we create control-icons for
array $rec: The current record of that foreign_table
array $config: (modified) TCA configuration of the field
Renvoie:
string The HTML code with the control-icons

t3lib_TCEforms_inline::renderCombinationTable ( &$  rec,
appendFormFieldNames,
config = array() 
)

Render a table with TCEforms, that occurs on a intermediate table but should be editable directly, so two tables are combined (the intermediate table with attributes and the sub-embedded table). -> This is a direct embedding over two levels!

Paramètres:
array $rec: The table record of the child/embedded table (normaly post-processed by t3lib_transferData)
string $appendFormFieldNames: The [
[<uid>] of the parent record (the intermediate table)
array 
config
PA['fieldConf']['config']
Renvoie:
string A HTML string with
around.

t3lib_TCEforms_inline::renderPossibleRecordsSelector ( selItems,
conf,
uniqueIds = array() 
)

Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).

Paramètres:
array $selItems: Array of all possible records
array $conf: TCA configuration of the parent(!) field
array $uniqueIds: The uids that have already been used and should be unique
Renvoie:
string A HTML <select> box with all possible records

t3lib_TCEforms_inline::renderPossibleRecordsSelectorTypeSelect ( selItems,
conf,
&$  PA,
uniqueIds = array() 
)

Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).

Paramètres:
array $selItems: Array of all possible records
array $conf: TCA configuration of the parent(!) field
array $PA: An array with additional configuration options
array $uniqueIds: The uids that have already been used and should be unique
Renvoie:
string A HTML <select> box with all possible records

t3lib_TCEforms_inline::renderPossibleRecordsSelectorTypeGroupDB ( conf,
&$  PA 
)

Generate a link that opens an element browser in a new window. For group/db there is no way o use a "selector" like a <select>|</select>-box.

Paramètres:
array $conf: TCA configuration of the parent(!) field
array $PA: An array with additional configuration options
Renvoie:
string A HTML link that opens an element browser in a new window

t3lib_TCEforms_inline::getNewRecordLink ( objectPrefix,
conf = array() 
)

Creates a link/button to create new records

Paramètres:
string $objectPrefix: The "path" to the child record to create (e.g. '[parten_table][parent_uid][parent_field][child_table]')
array $conf: TCA configuration of the parent(!) field
Renvoie:
string The HTML code for the new record link

t3lib_TCEforms_inline::addJavaScriptSortable ( objectId  ) 

Add Sortable functionality using script.acolo.us "Sortable".

Paramètres:
string $objectId: The container id of the object - elements inside will be sortable
Renvoie:
void

t3lib_TCEforms_inline::initForAJAX ( method,
&$  arguments 
)

Initialize environment for AJAX calls

Paramètres:
string $method: Name of the method to be called
array $arguments: Arguments to be delivered to the method
Renvoie:
void

t3lib_TCEforms_inline::createNewRecord ( domObjectId,
foreignUid = 0 
)

Handle AJAX calls to show a new inline-record of the given table. Normally this method is never called from inside TYPO3. Always from outside by AJAX.

Paramètres:
string $domObjectId: The calling object in hierarchy, that requested a new record.
string $foreignUid: If set, the new record should be inserted after that one.
Renvoie:
string A JSON string

t3lib_TCEforms_inline::setExpandedCollapsedState ( domObjectId,
expand,
collapse 
)

Save the expanded/collapsed state of a child record in the BE_USER->uc.

Paramètres:
string $domObjectId: The calling object in hierarchy, that requested a new record.
string $expand: Whether this record is expanded.
string $collapse: Whether this record is collapsed.
Renvoie:
void

t3lib_TCEforms_inline::getRelatedRecords ( table,
field,
row,
&$  PA,
config 
)

Get the related records of the embedding item, this could be 1:n, m:n.

Paramètres:
string $table: The table name of the record
string $field: The field name which this element is supposed to edit
array $row: The record data array where the value(s) for the field can be found
array $PA: An array with additional configuration options.
array 
config
PA['fieldConf']['config'] (for convenience)
Renvoie:
array The records related to the parent item

t3lib_TCEforms_inline::getPossibleRecords ( table,
field,
row,
conf,
checkForConfField = 'foreign_selector' 
)

Get possible records. Copied from TCEform and modified.

Paramètres:
string The table name of the record
string The field name which this element is supposed to edit
array The record data array where the value(s) for the field can be found
array An array with additional configuration options.
string $checkForConfField: For which field in the foreign_table the possible records should be fetched
Renvoie:
mixed Array of possible record items; false if type is "group/db", then everything could be "possible"

t3lib_TCEforms_inline::getUniqueIds ( records,
conf = array(),
splitValue = false 
)

Gets the uids of a select/selector that should be unique an have already been used.

Paramètres:
array $records: All inline records on this level
array $conf: The TCA field configuration of the inline field to be rendered
boolean $splitValue: for usage with group/db, values come like "tx_table_123|Title%20abc", but we need "tx_table" and "123"
Renvoie:
array The uids, that have been used already and should be used unique

t3lib_TCEforms_inline::getRecord ( pid,
table,
uid,
cmd = '' 
)

Get a single record row for a TCA table from the database. t3lib_transferData is used for "upgrading" the values, especially the relations.

Paramètres:
integer $pid: The pid of the page the record should be stored (only relevant for NEW records)
string $table: The table to fetch data from (= foreign_table)
string $uid: The uid of the record to fetch, or empty if a new one should be created
string $cmd: The command to perform, empty or 'new'
Renvoie:
array A record row from the database post-processed by t3lib_transferData

t3lib_TCEforms_inline::getNewRecord ( pid,
table 
)

Wrapper. Calls getRecord in case of a new record should be created.

Paramètres:
integer $pid: The pid of the page the record should be stored (only relevant for NEW records)
string $table: The table to fetch data from (= foreign_table)
Renvoie:
array A record row from the database post-processed by t3lib_transferData

t3lib_TCEforms_inline::pushStructure ( table,
uid,
field = '',
config = array() 
)

Add a new level on top of the structure stack. Other functions can access the stack and determine, if there's possibly a endless loop.

Paramètres:
string $table: The table name of the record
string $uid: The uid of the record that embeds the inline data
string $field: The field name which this element is supposed to edit
array $config: The TCA-configuration of the inline field
Renvoie:
void

t3lib_TCEforms_inline::popStructure (  ) 

Remove the item on top of the structure stack and return it.

Renvoie:
array The top item of the structure stack - array(<table>,<uid>,<field>,<config>)

t3lib_TCEforms_inline::updateStructureNames (  ) 

For common use of DOM object-ids and form field names of a several inline-level, these names/identifiers are preprocessed and set to $this->inlineNames. This function is automatically called if a level is pushed to or removed from the inline structure stack.

Renvoie:
void

t3lib_TCEforms_inline::getStructureItemName ( levelData  ) 

Create a name/id for usage in HTML output of a level of the structure stack.

Paramètres:
array $levelData: Array of a level of the structure stack (containing the keys table, uid and field)
Renvoie:
string The name/id of that level, to be used for HTML output

t3lib_TCEforms_inline::getStructureLevel ( level  ) 

Get a level from the stack and return the data. If the $level value is negative, this function works top-down, if the $level value is positive, this function works bottom-up.

Paramètres:
integer $level: Which level to return
Renvoie:
array The item of the stack at the requested level

t3lib_TCEforms_inline::getStructurePath ( structureDepth = -1  ) 

Get the identifiers of a given depth of level, from the top of the stack to the bottom. An identifier consists looks like [
[<uid>][<field>].

Paramètres:
integer $structureDepth: How much levels to output, beginning from the top of the stack
Renvoie:
string The path of identifiers

t3lib_TCEforms_inline::parseStructureString ( string,
loadConfig = false 
)

Convert the DOM object-id of an inline container to an array. The object-id could look like 'data[inline][tx_mmftest_company][1][employees]'. The result is written to $this->inlineStructure. There are two keys:

Paramètres:
string $domObjectId: The DOM object-id
boolean $loadConfig: Load the TCA configuration for that level
Renvoie:
void

t3lib_TCEforms_inline::checkConfiguration ( &$  config  ) 

Does some checks on the TCA configuration of the inline field to render.

Paramètres:
array $config: Reference to the TCA field configuration
Renvoie:
boolean If critical configuration errors were found, false is returned

t3lib_TCEforms_inline::checkAccess ( cmd,
table,
theUid 
)

Checks the page access rights (Code for access check mostly taken from alt_doc.php) as well as the table access rights of the user.

Paramètres:
string $cmd: The command that sould be performed ('new' or 'edit')
string $table: The table to check access for
string $theUid: The record uid of the table
Renvoie:
boolean Returns true is the user has access, or false if not

t3lib_TCEforms_inline::compareStructureConfiguration ( compare  ) 

Check the keys and values in the $compare array against the ['config'] part of the top level of the stack. A boolean value is return depending on how the comparison was successful.

Paramètres:
array $compare: keys and values to compare to the ['config'] part of the top level of the stack
Renvoie:
boolean Whether the comparison was successful
Voir également:
arrayCompareComplex

t3lib_TCEforms_inline::normalizeUid ( string  ) 

Normalize a relation "uid" published by transferData, like "1|Company%201"

Paramètres:
string $string: A transferData reference string, containing the uid
Renvoie:
string The normalized uid

t3lib_TCEforms_inline::wrapFormsSection ( section,
styleAttrs = array(),
tableAttrs = array() 
)

Wrap the HTML code of a section with a table tag.

Paramètres:
string $section: The HTML code to be wrapped
array $styleAttrs: Attributes for the style argument in the table tag
array $tableAttrs: Attributes for the table tag (like width, border, etc.)
Renvoie:
string The wrapped HTML code

t3lib_TCEforms_inline::isInlineChildAndLabelField ( table,
field 
)

Checks if the $table is the child of a inline type AND the $field is the label field of this table. This function is used to dynamically update the label while editing. This has no effect on labels, that were processed by a TCEmain-hook on saving.

Paramètres:
string $table: The table to check
string $field: The field on this table to check
Renvoie:
boolean is inline child and field is responsible for the label

t3lib_TCEforms_inline::getStructureDepth (  ) 

Get the depth of the stable structure stack. (count($this->inlineStructure['stable'])

Renvoie:
integer The depth of the structure stack

t3lib_TCEforms_inline::arrayCompareComplex ( subjectArray,
searchArray,
type = '' 
)

Handles complex comparison requests on an array. A request could look like the following:

$searchArray = array( 'AND' => array( 'key1' => 'value1', 'key2' => 'value2', 'OR' => array( 'subarray' => array( 'subkey' => 'subvalue' ), 'key3' => 'value3', 'key4' => 'value4' ) ) );

It is possible to use the array keys 'AND.1', 'AND.2', etc. to prevent overwriting the sub-array. It could be neccessary, if you use complex comparisons.

The example above means, key1 *AND* key2 (and their values) have to match with the $subjectArray and additional one *OR* key3 or key4 have to meet the same condition. It is also possible to compare parts of a sub-array (e.g. "subarray"), so this function recurses down one level in that sub-array.

Paramètres:
array $subjectArray: The array to search in
array $searchArray: The array with keys and values to search for
string $type: Use 'AND' or 'OR' for comparision
Renvoie:
boolean The result of the comparison

t3lib_TCEforms_inline::isAssociativeArray ( object  ) 

Checks whether an object is an associative array.

Paramètres:
mixed $object: The object to be checked
Renvoie:
boolean Returns true, if the object is an associative array

t3lib_TCEforms_inline::removeFromArray ( needle,
haystack,
strict = null 
)

Remove an element from an array.

Paramètres:
mixed $needle: The element to be removed.
array $haystack: The array the element should be removed from.
mixed $strict: Search elements strictly.
Renvoie:
array The array $haystack without the $needle

t3lib_TCEforms_inline::getPossibleRecordsFlat ( possibleRecords  ) 

Makes a flat array from the $possibleRecords array. The key of the flat array is the value of the record, the value of the flat array is the label of the record.

Paramètres:
array $possibleRecords: The possibleRecords array (for select fields)
Renvoie:
mixed A flat array with key=uid, value=label; if $possibleRecords isn't an array, false is returned.

t3lib_TCEforms_inline::getPossibleRecordsSelectorConfig ( conf,
field = '' 
)

Determine the configuration and the type of a record selector.

Paramètres:
array $conf: TCA configuration of the parent(!) field
Renvoie:
array Associative array with the keys 'PA' and 'type', both are false if the selector was not valid.

t3lib_TCEforms_inline::getPossibleRecordsSelectorType ( config  ) 

Determine the type of a record selector, e.g. select or group/db.

Paramètres:
array $config: TCE configuration of the selector
Renvoie:
mixed The type of the selector, 'select' or 'groupdb' - false not valid

t3lib_TCEforms_inline::skipField ( table,
field,
row,
config 
)

Check, if a field should be skipped, that was defined to be handled as foreign_field or foreign_sortby of the parent record of the "inline"-type - if so, we have to skip this field - the rendering is done via "inline" as hidden field

Paramètres:
string $table: The table name
string $field: The field name
array $row: The record row from the database
array $config: TCA configuration of the field
Renvoie:
boolean Determines whether the field should be skipped.

t3lib_TCEforms_inline::getJSON ( jsonArray  ) 

Creates recursively a JSON literal from a mulidimensional associative array. Uses Services_JSON (http://mike.teczno.com/JSON/doc/)

Paramètres:
array $jsonArray: The array (or part of) to be transformed to JSON
Renvoie:
string If $level>0: part of JSON literal; if $level==0: whole JSON literal wrapped with <script> tags

t3lib_TCEforms_inline::getExpandedCollapsedState ( table,
uid 
)

Checks if a uid of a child table is in the inline view settings.

Paramètres:
string $table: Name of the child table
integer $uid: uid of the the child record
Renvoie:
boolean true=expand, false=collapse

t3lib_TCEforms_inline::updateInlineView ( &$  uc,
&$  tce 
)

Update expanded/collapsed states on new inline records if any.

Paramètres:
array $uc: The uc array to be processed and saved (by reference)
object $tce: Instance of TCEmain that saved data before (by reference)
Renvoie:
void

t3lib_TCEforms_inline::getLevelMargin (  ) 

Returns the the margin in pixels, that is used for each new inline level.

Renvoie:
integer A pixel value for the margin of each new inline level.


Documentation des données membres

t3lib_TCEforms_inline::$fObj

t3lib_TCEforms_inline::$backPath

t3lib_TCEforms_inline::$isAjaxCall = false

t3lib_TCEforms_inline::$inlineStructure = array()

t3lib_TCEforms_inline::$inlineFirstPid

t3lib_TCEforms_inline::$inlineNames = array()

t3lib_TCEforms_inline::$inlineData = array()

t3lib_TCEforms_inline::$inlineView = array()

t3lib_TCEforms_inline::$inlineCount = 0

t3lib_TCEforms_inline::$inlineStyles = array()

t3lib_TCEforms_inline::$prependNaming = 'data'

t3lib_TCEforms_inline::$prependFormFieldNames

t3lib_TCEforms_inline::$prependCmdFieldNames


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:42:50 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3