From d2c4a6e2e995b77e1ee540fa3f6dcced61ba7771 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 20 Apr 2021 16:30:13 +0200 Subject: [PATCH] UIContentBlock: Add PrependSubBlock() to add a block in first position --- .../application/UI/Base/Layout/UIContentBlock.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sources/application/UI/Base/Layout/UIContentBlock.php b/sources/application/UI/Base/Layout/UIContentBlock.php index 094ad8574..91e23b26f 100644 --- a/sources/application/UI/Base/Layout/UIContentBlock.php +++ b/sources/application/UI/Base/Layout/UIContentBlock.php @@ -71,6 +71,19 @@ class UIContentBlock extends UIBlock implements iUIContentBlock return $this; } + /** + * Add $oSubBlock as the first of the sub blocks, while preserving the array indexes + * + * @param \Combodo\iTop\Application\UI\Base\iUIBlock $oSubBlock + * + * @return $this + */ + public function PrependSubBlock(iUIBlock $oSubBlock) + { + $this->aSubBlocks = [$oSubBlock->GetId() => $oSubBlock] + $this->aSubBlocks; + return $this; + } + /** * @inheritDoc */