From 4ff0f3c4a0dc3f2797070e649834f19ce83eec0e Mon Sep 17 00:00:00 2001 From: odain Date: Tue, 12 May 2026 11:54:46 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B09567=20-=20add=20enc=5Ftype=20in=20UIFor?= =?UTF-8?q?m=20to=20be=20able=20to=20change=20content=20type=20in=20twigs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/AnalysisResult.html.twig | 2 +- .../UI/Base/Component/Form/Form.php | 23 +++++++++++++++++++ .../base/components/form/layout.html.twig | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig index 37f7cd6a61..66871f0ce5 100644 --- a/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig +++ b/datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig @@ -36,7 +36,7 @@ {% else %} {% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:CleanupComplete:Title'|dict_s, sContent:'DataFeatureRemoval:CompilComplete'|dict_s, sId:value } %}{% EndUIAlert %} - {% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl} %} + {% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl, 'EncType': 'application/x-www-form-urlencoded'} %} {% for sKey, sValue in aSetupParams %} {% UIInput ForHidden { sName:sKey, sValue:sValue } %} {% endfor %} diff --git a/sources/Application/UI/Base/Component/Form/Form.php b/sources/Application/UI/Base/Component/Form/Form.php index 6242a18bb7..beba58c738 100644 --- a/sources/Application/UI/Base/Component/Form/Form.php +++ b/sources/Application/UI/Base/Component/Form/Form.php @@ -24,6 +24,8 @@ class Form extends UIContentBlock protected $sOnSubmitJsCode; /** @var string */ protected $sAction; + /** @var string */ + protected $sEncType = "multipart/form-data"; public function __construct(?string $sId = null) { @@ -65,4 +67,25 @@ class Form extends UIContentBlock return $this; } + /** + * Override default enctype (default : "multipart/form-data") + * @param string $sEncType + * @return $this + * @since 3.3.0 + */ + public function SetEncType(string $sEncType) + { + $this->sEncType = $sEncType; + return $this; + } + + /** +* @return string + * @since 3.3.0 + */ + public function GetEncType(): string + { + return $this->sEncType; + } + } diff --git a/templates/base/components/form/layout.html.twig b/templates/base/components/form/layout.html.twig index 756dee0924..7b2808e7ce 100644 --- a/templates/base/components/form/layout.html.twig +++ b/templates/base/components/form/layout.html.twig @@ -1,4 +1,4 @@ -