N°2847 - Add method to add several blocks at once to a content area (tUIContentAreas)

This commit is contained in:
Molkobain
2021-03-04 15:13:46 +01:00
parent cf956099ac
commit 9bdccb0fb3
3 changed files with 96 additions and 7 deletions

View File

@@ -93,12 +93,28 @@ class PageContent extends UIBlock implements iUIContentBlock {
*
* @return $this
*/
public function AddMainBlock(iUIBlock $oBlock) {
public function AddMainBlock(iUIBlock $oBlock)
{
$this->AddBlockToContentArea(static::ENUM_CONTENT_AREA_MAIN, $oBlock);
return $this;
}
/**
* Add all $aBlocks to the main content area
*
* @param \Combodo\iTop\Application\UI\Base\iUIBlock[] $aBlocks
*
* @return $this
* @uses static::AddBlocksToContentArea()
*/
public function AddMainBlocks(array $aBlocks)
{
$this->AddBlocksToContentArea(static::ENUM_CONTENT_AREA_MAIN, $aBlocks);
return $this;
}
/**
* Remove the main block identified by $sBlockId.
* Note that if no block with that ID exists, it will proceed silently.
@@ -107,7 +123,8 @@ class PageContent extends UIBlock implements iUIContentBlock {
*
* @return $this
*/
public function RemoveMainBlock(string $sBlockId) {
public function RemoveMainBlock(string $sBlockId)
{
$this->RemoveBlockFromContentArea(static::ENUM_CONTENT_AREA_MAIN, $sBlockId);
return $this;