Fixed a FlexForm problem in class.t3lib_transferdata.php
authorKasper Skårhøj <kasper@typo3.org>
Tue, 23 Mar 2004 16:32:00 +0000 (16:32 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Tue, 23 Mar 2004 16:32:00 +0000 (16:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@148 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_transferdata.php

index 1dadcdf..8d4c86f 100755 (executable)
  *  515:     function getListedFields($table,$row,$list)       
  *  556:     function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')       
  *  632:     function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)       
- *  760:     function getSingleField_SW($table,$field,$row,&$PA)       
+ *  760:     function getSingleField_SW($table,$field,$row,&$PA)
  *
  *              SECTION: Rendering of each TCEform field type
  *  831:     function getSingleField_typeInput($table,$field,$row,&$PA)        
  *  883:     function getSingleField_typeText($table,$field,$row,&$PA) 
  *  986:     function getSingleField_typeCheck($table,$field,$row,&$PA)        
  * 1045:     function getSingleField_typeRadio($table,$field,$row,&$PA)        
- * 1075:     function getSingleField_typeSelect($table,$field,$row,&$PA)       
+ * 1075:     function getSingleField_typeSelect($table,$field,$row,&$PA)
  * 1236:     function getSingleField_typeGroup($table,$field,$row,&$PA)        
  * 1380:     function getSingleField_typeNone($table,$field,$row,&$PA) 
  * 1434:     function getSingleField_typeFlex($table,$field,$row,&$PA) 
  * 1535:     function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)  
  * 1554:     function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)       
- * 1584:     function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())      
+ * 1584:     function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
  * 1734:     function getSingleField_typeUnknown($table,$field,$row,&$PA)      
  * 1749:     function getSingleField_typeUser($table,$field,$row,&$PA) 
  *
@@ -71,7 +71,7 @@
  * 1835:     function getExcludeElements($table,$row,$typeNum) 
  * 1883:     function getFieldsToAdd($table,$row,$typeNum)     
  * 1908:     function mergeFieldsWithAddedFields($fields,$fieldsToAdd) 
- * 1940:     function setTSconfig($table,$row,$field='')       
+ * 1940:     function setTSconfig($table,$row,$field='')
  * 1962:     function getSpecConfForField($table,$row,$field)  
  * 1982:     function getSpecConfFromString($extraString)    
  *
  * 2465:     function insertDefStyle($type)    
  *
  *              SECTION: Item-array manipulation functions (check/select/radio)
- * 2496:     function initItemArray($fieldValue)       
+ * 2496:     function initItemArray($fieldValue)
  * 2514:     function addItems($items,$iArray) 
  * 2536:     function procItems($items,$iArray,$config,$table,$row,$field)     
- * 2560:     function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field) 
- * 2638:     function addSelectOptionsToItemArray_makeModuleData($value)       
+ * 2560:     function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
+ * 2638:     function addSelectOptionsToItemArray_makeModuleData($value)
  * 2660:     function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)      
  *
  *              SECTION: Template functions
@@ -1933,7 +1933,7 @@ class t3lib_TCEforms      {
         *
         * @param       string          The table name
         * @param       array           The table row (Should at least contain the "uid" value, even if "NEW..." string. The "pid" field is important as well, and negative values will be intepreted as pointing to a record from the same table.)
-        * @param       string          Optionally you can specify the field name as well. If that case the TSconfig for the field is returned.
+        * @param       string          Optionally you can specify the field name as well. In that case the TSconfig for the field is returned.
         * @return      mixed           The TSconfig values (probably in an array)
         * @see t3lib_BEfunc::getTCEFORM_TSconfig()
         */
index 6c9c772..9300bd3 100755 (executable)
  *
  *              SECTION: Getting record content, ready for display in TCEforms
  *  135:     function fetchRecord($table,$idList,$operation)   
- *  221:     function renderRecord($table, $id, $pid, $row)    
- *  288:     function renderRecord_SW($data,$fieldConfig,$TSconfig,$table,$row,$field) 
- *  318:     function renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)  
- *  369:     function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field) 
- *  431:     function renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)   
+ *  221:     function renderRecord($table, $id, $pid, $row)
+ *  288:     function renderRecord_SW($data,$fieldConfig,$TSconfig,$table,$row,$field)
+ *  318:     function renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
+ *  369:     function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
+ *  431:     function renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
  *  460:     function renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)       
  *
  *              SECTION: FlexForm processing functions
- *  544:     function renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)    
- *  573:     function renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams)               
+ *  544:     function renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)
+ *  573:     function renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams)
  *
  *              SECTION: Selector box processing functions
  *  648:     function selectAddSpecial($dataAcc, $elements, $specialKey)       
- *  728:     function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row)     
- *  781:     function getDataIdList($elements, $fieldConfig, $row)     
- *  804:     function procesItemArray($selItems,$config,$fieldTSConfig,$table,$row,$field)     
+ *  728:     function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row)
+ *  781:     function getDataIdList($elements, $fieldConfig, $row)
+ *  804:     function procesItemArray($selItems,$config,$fieldTSConfig,$table,$row,$field)
  *  819:     function addItems($items,$iArray) 
- *  841:     function procItems($items,$itemsProcFuncTSconfig,$config,$table,$row,$field)      
+ *  841:     function procItems($items,$itemsProcFuncTSconfig,$config,$table,$row,$field)
  *
  *              SECTION: Helper functions
  *  876:     function lockRecord($table, $id, $pid=0)  
@@ -368,7 +368,7 @@ class t3lib_transferData {
         */
        function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)       {
                global $TCA;
-               
+
                        // Initialize:
                $elements = t3lib_div::trimExplode(',',$data,1);        // Current data set.
                $dataAcc=array();       // New data set, ready for interface (list of values, rawurlencoded)
@@ -405,7 +405,7 @@ class t3lib_transferData {
                                // Getting the data
                                $dataIds = $this->getDataIdList($elements, $fieldConfig, $row);
 
-                               if (!count($dataIds))   $dataIds=array(0);
+                               if (!count($dataIds))   $dataIds = array(0);
                                $dataAcc[]=$dataIds[0];
                        } else {
                                $dataAcc[]=$elements[0];
@@ -416,7 +416,8 @@ class t3lib_transferData {
        }
        
        /**
-        * Processing of the data value in case the field type is "select"
+        * 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
@@ -602,15 +603,17 @@ class t3lib_transferData {
                                } else {
                                        if (is_array($dsConf['TCEforms']['config']) && is_array($dataValues[$key]))     {
                                                foreach($dataValues[$key] as $vKey => $data)    {
-                                                       list($CVtable,$CVrow,$CVfield) = $pParams;
 
+                                                               // $data,$fieldConfig,$TSconfig,$table,$row,$field
+                                                       list(,,$CVTSconfig,$CVtable,$CVrow,$CVfield) = $pParams;
+;
                                                                // Set default value:
                                                        if (!isset($dataValues[$key][$vKey]))   {
                                                                $dataValues[$key][$vKey] = $dsConf['TCEforms']['config']['default'];
                                                        }
-                                                       
+
                                                                // Process value:
-                                                       $dataValues[$key][$vKey] = $this->renderRecord_SW($dataValues[$key][$vKey],$dsConf['TCEforms'],array(),$CVtable,$CVrow,'');
+                                                       $dataValues[$key][$vKey] = $this->renderRecord_SW($dataValues[$key][$vKey],$dsConf['TCEforms'],$CVTSconfig,$CVtable,$CVrow,'');
                                                }                       
                                        }
                                }
@@ -727,7 +730,7 @@ class t3lib_transferData {
         */
        function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row)   {
                global $TCA;
-               
+
                        // Init:
                $recordList = Array();
 
@@ -749,7 +752,7 @@ class t3lib_transferData {
                        // Now, get the data from loadDBgroup based on the input list of values.
                $dataIds = $this->getDataIdList($elements, $fieldConfig, $row);
                if ($fieldConfig['config']['MM'])       $dataAcc=array();       // Reset, if MM (which cannot bear anything but real relations!)
-               
+
                        // After this we can traverse the loadDBgroup values and match values with the list of possible values in $recordList:
                foreach($dataIds as $theId)     {
                        if (isset($recordList[$theId])) {
@@ -909,4 +912,4 @@ class t3lib_transferData {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_transferdata.php'])     {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_transferdata.php']);
 }
-?>
\ No newline at end of file
+?>