mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Allow inputs to be disabled and readonly
This commit is contained in:
@@ -21,6 +21,9 @@ class Input extends AbstractInput
|
||||
public const INPUT_HIDDEN = 'hidden';
|
||||
|
||||
protected $bIsChecked = false;
|
||||
|
||||
protected $bIsDisabled = false;
|
||||
protected $bIsReadonly = false;
|
||||
|
||||
/** @var string */
|
||||
protected $sType;
|
||||
@@ -60,4 +63,42 @@ class Input extends AbstractInput
|
||||
{
|
||||
return $this->bIsChecked;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function IsDisabled()
|
||||
{
|
||||
return $this->bIsDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bIsDisabled
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetIsDisabled(bool $bIsDisabled)
|
||||
{
|
||||
$this->bIsDisabled = $bIsDisabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function IsReadonly()
|
||||
{
|
||||
return $this->bIsReadonly;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bIsReadonly
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetIsReadonly(bool $bIsReadonly)
|
||||
{
|
||||
$this->bIsReadonly = $bIsReadonly;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,10 @@
|
||||
{% endblock %}
|
||||
{% block iboInput %}
|
||||
<input type="{{ oUIBlock.GetType() }}" id="{{ oUIBlock.GetId() }}" name="{{ oUIBlock.GetName() }}" value="{{ oUIBlock.GetValue()|raw }}"
|
||||
class="{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}{% if oUIBlock.GetAdditionalCSSClassesAsString() %} {{ oUIBlock.GetAdditionalCSSClassesAsString() }}{% endif %}"
|
||||
class="ibo-input {% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}{% if oUIBlock.GetAdditionalCSSClassesAsString() %} {{ oUIBlock.GetAdditionalCSSClassesAsString() }}{% endif %}"
|
||||
{% if oUIBlock.IsChecked() %} checked="checked"{% endif %}
|
||||
{% if oUIBlock.IsDisabled() %} disabled{% endif %}
|
||||
{% if oUIBlock.IsReadonly() %} readonly{% endif %}
|
||||
{% if oUIBlock.GetDataAttributes() %}
|
||||
{% for sName, sValue in oUIBlock.GetDataAttributes() %}
|
||||
data-{{ sName }}="{{ sValue }}"
|
||||
|
||||
Reference in New Issue
Block a user