-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
263 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,15 @@ | |
|
||
namespace Sys25\RnBase\Backend\Form; | ||
|
||
use Sys25\RnBase\Backend\Module\IModule; | ||
use Sys25\RnBase\Utility\TYPO3; | ||
use tx_rnbase; | ||
use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2016-2021 Rene Nitzsche ([email protected]) | ||
* (c) 2016-2025 Rene Nitzsche ([email protected]) | ||
* All rights reserved | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
|
@@ -49,6 +51,11 @@ class FormBuilder | |
*/ | ||
private $formResultCompiler; | ||
|
||
/** | ||
* @var IModule | ||
*/ | ||
private $module; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
|
@@ -57,16 +64,17 @@ class FormBuilder | |
public function __construct() | ||
{ | ||
/** | ||
* @var \TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord | ||
* @var TcaDatabaseRecord | ||
*/ | ||
$formDataGroup = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormDataGroup\\TcaDatabaseRecord'); | ||
$this->formDataCompiler = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormDataCompiler', $formDataGroup); | ||
$this->nodeFactory = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\NodeFactory'); | ||
$this->formResultCompiler = tx_rnbase::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormResultCompiler'); | ||
} | ||
|
||
public function initDefaultBEmode() | ||
public function setModule(IModule $module) | ||
{ | ||
$this->module = $module; | ||
} | ||
|
||
/** | ||
|
@@ -128,7 +136,13 @@ protected function compileFormData($table, $uid, $record) | |
'returnUrl' => '', | ||
]; | ||
} | ||
$this->formDataCache[$cacheKey] = $this->formDataCompiler->compile($formDataCompilerInput); | ||
$formDataCompilerInput['request'] = $this->module->getRequest(); | ||
|
||
if (TYPO3::isTYPO130OrHigher()) { | ||
$this->formDataCache[$cacheKey] = $this->formDataCompiler->compile($formDataCompilerInput, tx_rnbase::makeInstance(TcaDatabaseRecord::class)); | ||
} else { | ||
$this->formDataCache[$cacheKey] = $this->formDataCompiler->compile($formDataCompilerInput); | ||
} | ||
if ($this->isNEWRecord($uid)) { | ||
// Override generated with given uid | ||
$this->formDataCache[$cacheKey]['databaseRow']['uid'] = $uid; | ||
|
@@ -171,11 +185,7 @@ public function getSoloField($table, $row, $fieldName) | |
*/ | ||
public function printNeededJSFunctions_top() | ||
{ | ||
if (TYPO3::isTYPO90OrHigher()) { | ||
$result = $this->formResultCompiler->addCssFiles(); | ||
} else { | ||
$result = $this->formResultCompiler->JStop(); | ||
} | ||
$result = $this->formResultCompiler->addCssFiles(); | ||
|
||
return $result; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.