mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +02:00
N°3536 - revert function and use GetSubBlocks() instead
This commit is contained in:
@@ -98,7 +98,7 @@ class ConsoleBlockRenderer extends BlockRenderer
|
||||
$oPage->add_ready_script($oBlockRenderer->RenderJsInline(iUIBlock::ENUM_JS_TYPE_ON_READY));
|
||||
$oPage->add_style($oBlockRenderer->RenderCssInline());
|
||||
|
||||
foreach ($oBlock->GetSubBlocksForCSSAndJS() as $oSubBlock) {
|
||||
foreach ($oBlock->GetSubBlocks() as $oSubBlock) {
|
||||
static::AddCssJsTemplatesToPageRecursively($oPage, $oSubBlock, $aContextParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,6 @@ class UIDashboardLayoutBlock extends UIBlock
|
||||
}
|
||||
|
||||
public function GetSubBlocks()
|
||||
{
|
||||
return $this->aDashboardRows;
|
||||
}
|
||||
|
||||
public function GetSubBlocksForCSSAndJS()
|
||||
{
|
||||
return array_merge($this->aDashboardRows, [$this->oToolbar]);
|
||||
}
|
||||
@@ -78,4 +73,12 @@ class UIDashboardLayoutBlock extends UIBlock
|
||||
{
|
||||
$this->sTitle = $sTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow[]
|
||||
*/
|
||||
public function GetDashboardRows(): array
|
||||
{
|
||||
return $this->aDashboardRows;
|
||||
}
|
||||
}
|
||||
@@ -197,15 +197,6 @@ abstract class UIBlock implements iUIBlock
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @return \Combodo\iTop\Application\UI\Base\iUIBlock[]
|
||||
*/
|
||||
public function GetSubBlocksForCSSAndJS()
|
||||
{
|
||||
return $this->GetSubBlocks();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @return \Combodo\iTop\Application\UI\Base\iUIBlock[]
|
||||
|
||||
@@ -91,15 +91,6 @@ interface iUIBlock {
|
||||
*/
|
||||
public function GetSubBlocks();
|
||||
|
||||
/**
|
||||
* Return an array iUIBlock embedded in this iUIBlock
|
||||
* Must be an associative array (<BLOCK_ID> => <BLOCK_INSTANCE>)
|
||||
* This is used to get recursively the CSS and JS templates
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\iUIBlock[]
|
||||
*/
|
||||
public function GetSubBlocksForCSSAndJS();
|
||||
|
||||
/**
|
||||
* Return an array of iUIBlock to add at the end of the page
|
||||
* Must be an associative array (<BLOCK_ID> => <BLOCK_INSTANCE>)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{ render_block(oUIBlock.GetToolbar(), {aPage: aPage}) }}
|
||||
</div>
|
||||
<div class="ibo-dashboard--grid" data-role="ibo-dashboard--grid">
|
||||
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
|
||||
{% for oSubBlock in oUIBlock.GetDashboardRows() %}
|
||||
{{ render_block(oSubBlock, {aPage: aPage}) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user