Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Controller/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Dispatcher extends AbstractPlugin
*/
protected $utilityFuncs;

public function main(): ResponseInterface
public function main(array $settings): ResponseInterface
{
$this->componentManager = GeneralUtility::makeInstance(Manager::class);
$this->globals = GeneralUtility::makeInstance(Globals::class);
Expand Down Expand Up @@ -87,7 +87,7 @@ public function main(): ResponseInterface
$controller->setPredefined($predef);
}

$result = $controller->process();
$result = $controller->process($settings);
return $result;
}
}
5 changes: 4 additions & 1 deletion Classes/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class FormController extends AbstractClass
protected ?Configuration $configuration = null;
protected ResponseFactory $responseFactory;
protected StreamFactory $streamFactory;
protected array $processSettings = [];

public function __construct()
{
Expand All @@ -57,8 +58,9 @@ public function __construct()

}

public function process(): ResponseInterface
public function process(array $settings): ResponseInterface
{
$this->processSettings = $settings;
$this->init();
$this->storeFileNamesInGP();
$this->processFileRemoval();
Expand Down Expand Up @@ -973,6 +975,7 @@ public function getSettings()
unset($settings['predef.']);
$settings = $this->utilityFuncs->mergeConfiguration($settings, $predefSettings);
}
$settings = $this->utilityFuncs->mergeConfiguration($settings, $this->processSettings);
return $settings;
}
}
6 changes: 5 additions & 1 deletion Classes/Controller/FormhandlerPluginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Typoheads\Formhandler\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class FormhandlerPluginController extends ActionController
Expand All @@ -11,7 +13,9 @@ public function indexAction(): ResponseInterface
{
$dispatcher = new Dispatcher();
$dispatcher->setRequests($this->request);
return $dispatcher->main('', []);
$typoscript = GeneralUtility::makeInstance(TypoScriptService::class);
$settings = $typoscript->convertPlainArrayToTypoScriptArray($this->settings);
return $dispatcher->main($settings);
}

}