@@ -39,9 +39,7 @@ class TranslatedMulti extends Base implements ITranslated, IComplex
3939 */
4040 public function getAttributeSettingNames ()
4141 {
42- return array_merge (parent ::getAttributeSettingNames (), array (
43- // ...
44- ));
42+ return array_merge (parent ::getAttributeSettingNames (), array ());
4543 }
4644
4745 /**
@@ -51,7 +49,7 @@ public function getAttributeSettingNames()
5149 */
5250 protected function getValueTable ()
5351 {
54- return 'tl_metamodel_translatedtabletext ' ;
52+ return 'tl_metamodel_translatedmulti ' ;
5553 }
5654
5755 /**
@@ -66,6 +64,14 @@ public function getFieldDefinition($arrOverrides = array())
6664
6765 // Check for override in local config
6866 if (isset ($ GLOBALS ['TL_CONFIG ' ]['metamodelsattribute_multi ' ][$ strTable ][$ strField ])) {
67+ // Cleanup the config.
68+ $ config = $ GLOBALS ['TL_CONFIG ' ]['metamodelsattribute_multi ' ][$ strTable ][$ strField ];
69+ foreach ($ config ['columnFields ' ] as $ col => $ data ) {
70+ $ config ['columnFields ' ]['col_ ' . $ col ] = $ data ;
71+ unset($ config ['columnFields ' ][$ col ]);
72+ }
73+
74+ // Build the array();
6975 $ arrFieldDef ['inputType ' ] = 'multiColumnWizard ' ;
7076 $ arrFieldDef ['eval ' ] = $ GLOBALS ['TL_CONFIG ' ]['metamodelsattribute_multi ' ][$ strTable ][$ strField ];
7177 } else {
@@ -93,28 +99,28 @@ protected function getWhere($mixIds, $strLangCode = null, $intRow = null, $intCo
9399 {
94100 $ arrReturn = array (
95101 'procedure ' => 'att_id=? ' ,
96- 'params ' => array (intval ($ this ->get ('id ' ))),
102+ 'params ' => array (intval ($ this ->get ('id ' ))),
97103 );
98104
99105 if ($ mixIds ) {
100106 if (is_array ($ mixIds )) {
101107 $ arrReturn ['procedure ' ] .= ' AND item_id IN ( ' . $ this ->parameterMask ($ mixIds ) . ') ' ;
102- $ arrReturn ['params ' ] = array_merge ($ arrReturn ['params ' ], $ mixIds );
108+ $ arrReturn ['params ' ] = array_merge ($ arrReturn ['params ' ], $ mixIds );
103109 } else {
104110 $ arrReturn ['procedure ' ] .= ' AND item_id=? ' ;
105- $ arrReturn ['params ' ][] = $ mixIds ;
111+ $ arrReturn ['params ' ][] = $ mixIds ;
106112 }
107113 }
108114
109115 if (is_int ($ intRow ) && is_int ($ intCol )) {
110116 $ arrReturn ['procedure ' ] .= ' AND row = ? AND col = ? ' ;
111- $ arrReturn ['params ' ][] = $ intRow ;
112- $ arrReturn ['params ' ][] = $ intCol ;
117+ $ arrReturn ['params ' ][] = $ intRow ;
118+ $ arrReturn ['params ' ][] = $ intCol ;
113119 }
114120
115121 if ($ strLangCode ) {
116122 $ arrReturn ['procedure ' ] .= ' AND langcode=? ' ;
117- $ arrReturn ['params ' ][] = $ strLangCode ;
123+ $ arrReturn ['params ' ][] = $ strLangCode ;
118124 }
119125
120126 return $ arrReturn ;
@@ -132,7 +138,7 @@ public function valueToWidget($varValue)
132138 $ widgetValue = array ();
133139 foreach ($ varValue as $ row ) {
134140 foreach ($ row as $ key => $ col ) {
135- $ widgetValue [$ col ['row ' ]]['col_ ' . $ key ] = $ col ['value ' ];
141+ $ widgetValue [$ col ['row ' ]]['col_ ' . $ col [ ' col ' ] ] = $ col ['value ' ];
136142 }
137143 }
138144
@@ -177,10 +183,10 @@ protected function getSetValues($arrCell, $intId, $strLangCode)
177183 {
178184 return array (
179185 'tstamp ' => time (),
180- 'value ' => (string ) $ arrCell ['value ' ],
186+ 'value ' => (string )$ arrCell ['value ' ],
181187 'att_id ' => $ this ->get ('id ' ),
182- 'row ' => (int ) $ arrCell ['row ' ],
183- 'col ' => ( int ) $ arrCell ['col ' ],
188+ 'row ' => (int )$ arrCell ['row ' ],
189+ 'col ' => $ arrCell ['col ' ],
184190 'item_id ' => $ intId ,
185191 'langcode ' => $ strLangCode ,
186192 );
@@ -341,6 +347,7 @@ public function getDataFor($arrIds)
341347 }
342348 }
343349 }
350+
344351 return $ arrReturn ;
345352 }
346353
@@ -355,7 +362,7 @@ public function unsetDataFor($arrIds)
355362 {
356363 if (!is_array ($ arrIds )) {
357364 throw new \RuntimeException (
358- 'TranslatedTableText ::unsetDataFor() invalid parameter given! Array of ids is needed. ' ,
365+ 'TranslatedMulti ::unsetDataFor() invalid parameter given! Array of ids is needed. ' ,
359366 1
360367 );
361368 }
0 commit comments