2 namespace TYPO3\CMS\Backend\Controller\Wizard;
89 parent::__construct();
109 $this->table = $this->P[
'params'][
'table'];
113 is_array($record) ? $record : array(
'pid' => $this->P[
'pid'])
116 if (substr($this->P[
'params'][
'pid'], 0, 3) ===
'###' && substr($this->P[
'params'][
'pid'], -3) ===
'###') {
117 $keyword = substr($this->P[
'params'][
'pid'], 3, -3);
118 if (strpos($keyword,
'PAGE_TSCONFIG_') === 0) {
119 $this->pid = (int)$TSconfig[$this->P[
'field']][$keyword];
121 $this->pid = (int)$TSconfig[
'_' . $keyword];
124 $this->pid = (int)$this->P[
'params'][
'pid'];
127 if ($this->pid ===
'') {
132 if ($this->returnEditConf) {
133 $editConfiguration = json_decode($this->returnEditConf,
true);
136 reset($editConfiguration[$this->table]);
137 $this->
id = (int)key($editConfiguration[$this->table]);
138 $cmd = current($editConfiguration[$this->table]);
141 if ($this->P[
'params'][
'setValue']
145 && $this->P[
'field'] && $this->P[
'uid']
149 $this->
id = $liveRecord[
'uid'];
151 $this->processDataFlag = 1;
177 public function main()
179 if ($this->returnEditConf) {
180 if ($this->processDataFlag) {
186 $formDataGroup->setProviderList([ DatabaseEditRow::class ]);
190 'tableName' => $this->P[
'table'],
191 'vanillaUid' => (int)$this->P[
'uid'],
194 $result = $formDataCompiler->compile($input);
195 $currentParentRow = $result[
'databaseRow'];
199 if (is_array($currentParentRow)) {
202 $dataHandler->stripslashes_values =
false;
204 $recordId = $this->table .
'_' .
$this->id;
207 if ($this->P[
'flexFormPath']) {
212 $currentFlexFormValue = $flexFormTools->getArrayValueByPath(
213 $this->P[
'flexFormPath'],
217 switch ((
string)$this->P[
'params'][
'setValue']) {
219 $insertValue = $recordId;
222 $insertValue = $currentFlexFormValue .
',' . $recordId;
225 $insertValue = $recordId .
',' . $currentFlexFormValue;
229 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']] = array();
230 $flexFormTools->setArrayValueByPath(
231 $this->P[
'flexFormPath'],
232 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']],
236 switch ((
string)$this->P[
'params'][
'setValue']) {
238 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']] = $recordId;
241 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']] = $currentParentRow[$this->P[
'field']] .
',' . $recordId;
244 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']] = $recordId .
',' . $currentParentRow[$this->P[
'field']];
247 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']] = implode(
251 $data[$this->P[
'table']][$this->P[
'uid']][$this->P[
'field']],
257 $dataHandler->start($data, array());
258 $dataHandler->process_datamap();
266 $redirectUrl = BackendUtility::getModuleUrl(
'record_edit', array(
267 'returnEditConf' => 1,
268 'edit[' . $this->P[
'params'][
'table'] .
'][' . $this->pid .
']' =>
'new',