mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9567 - add enc_type in UIForm to be able to change content type in twigs
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% UIAlert ForSuccess { sTitle:'DataFeatureRemoval:CleanupComplete:Title'|dict_s, sContent:'DataFeatureRemoval:CompilComplete'|dict_s, sId:value } %}{% EndUIAlert %}
|
{% 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 %}
|
{% for sKey, sValue in aSetupParams %}
|
||||||
{% UIInput ForHidden { sName:sKey, sValue:sValue } %}
|
{% UIInput ForHidden { sName:sKey, sValue:sValue } %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ class Form extends UIContentBlock
|
|||||||
protected $sOnSubmitJsCode;
|
protected $sOnSubmitJsCode;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $sAction;
|
protected $sAction;
|
||||||
|
/** @var string */
|
||||||
|
protected $sEncType = "multipart/form-data";
|
||||||
|
|
||||||
public function __construct(?string $sId = null)
|
public function __construct(?string $sId = null)
|
||||||
{
|
{
|
||||||
@@ -65,4 +67,25 @@ class Form extends UIContentBlock
|
|||||||
return $this;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form method="post" enctype="multipart/form-data" id="{{ oUIBlock.GetId() }}"
|
<form method="post" enctype="{{ oUIBlock.GetEncType() }}" id="{{ oUIBlock.GetId() }}"
|
||||||
class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %}"
|
class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %}"
|
||||||
data-role="ibo-form"
|
data-role="ibo-form"
|
||||||
{% if oUIBlock.GetOnSubmitJsCode() %}
|
{% if oUIBlock.GetOnSubmitJsCode() %}
|
||||||
|
|||||||
Reference in New Issue
Block a user