mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
Rework efcd065 method of determining whether UIContentBlock needs a div tag
This commit is contained in:
@@ -638,12 +638,12 @@ try {
|
||||
if ($bShouldConfirm) {
|
||||
$sYesButton = Dict::S('UI:Button:Ok');
|
||||
$sNoButton = Dict::S('UI:Button:Cancel');
|
||||
$oDlg = UIContentBlockUIBlockFactory::MakeStandard("dlg_confirmation");
|
||||
$oDlg = UIContentBlockUIBlockFactory::MakeStandard("dlg_confirmation")->SetHasForcedDiv(true);
|
||||
$oPage->AddSubBlock($oDlg);
|
||||
$oDlg->AddSubBlock(new Html($sMessage));
|
||||
$oDlg->AddSubBlock(new Html(htmlentities(Dict::S('UI:CSVImportConfirmMessage'), ENT_QUOTES, 'UTF-8')));
|
||||
|
||||
$oDlgConfirm = UIContentBlockUIBlockFactory::MakeStandard("confirmation_chart");
|
||||
$oDlgConfirm = UIContentBlockUIBlockFactory::MakeStandard("confirmation_chart")->SetHasForcedDiv(true);
|
||||
$oDlg->AddSubBlock($oDlgConfirm);
|
||||
|
||||
$sDlgTitle = Dict::S('UI:CSVImportConfirmTitle');
|
||||
|
||||
@@ -31,7 +31,9 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
|
||||
/** @var array */
|
||||
protected $aSubBlocks;
|
||||
/** @var array */
|
||||
protected $aDeferredBlocks;
|
||||
protected $aDeferredBlocks;
|
||||
/** @var array */
|
||||
protected $bHasForcedDiv;
|
||||
|
||||
/**
|
||||
* UIContentBlock constructor.
|
||||
@@ -46,6 +48,7 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
|
||||
|
||||
$this->aSubBlocks = [];
|
||||
$this->aDeferredBlocks = [];
|
||||
$this->bHasForcedDiv = false;
|
||||
$this->SetCSSClasses($aContainerClasses);
|
||||
}
|
||||
|
||||
@@ -197,5 +200,15 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function HasForcedDiv(): bool
|
||||
{
|
||||
return $this->bHasForcedDiv;
|
||||
}
|
||||
|
||||
public function SetHasForcedDiv(bool $bHasForcedDiv)
|
||||
{
|
||||
$this->bHasForcedDiv = $bHasForcedDiv;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{# Content Block #}
|
||||
{% apply spaceless %}
|
||||
|
||||
{% set bHasDiv = (oUIBlock.GetAdditionalCSSClassesAsString() or oUIBlock.GetBlocksInheritanceCSSClassesAsString() or oUIBlock.GetDataAttributes() or oUIBlock.IsHidden()) %}
|
||||
{% set bHasDiv = (oUIBlock.GetAdditionalCSSClassesAsString() or oUIBlock.GetDataAttributes() or oUIBlock.IsHidden() or oUIBlock.HasForcedDiv()) %}
|
||||
|
||||
{% block iboContentBlockContainer %}
|
||||
{% if bHasDiv %}
|
||||
|
||||
Reference in New Issue
Block a user