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

@@ -230,12 +230,28 @@ class Panel extends UIContentBlock
*
* @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 blocks
*
* @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.
@@ -244,7 +260,8 @@ class Panel extends UIContentBlock
*
* @return $this
*/
public function RemoveMainBlock(string $sBlockId) {
public function RemoveMainBlock(string $sBlockId)
{
$this->RemoveBlockFromContentArea(static::ENUM_CONTENT_AREA_MAIN, $sBlockId);
return $this;
@@ -281,12 +298,28 @@ class Panel extends UIContentBlock
*
* @return $this
*/
public function AddToolbarBlock(iUIBlock $oBlock) {
public function AddToolbarBlock(iUIBlock $oBlock)
{
$this->AddBlockToContentArea(static::ENUM_CONTENT_AREA_TOOLBAR, $oBlock);
return $this;
}
/**
* Add all $aBlocks to the toolbar blocks
*
* @param \Combodo\iTop\Application\UI\Base\iUIBlock[] $aBlocks
*
* @return $this
* @uses static::AddBlocksToContentArea()
*/
public function AddToolbarBlocks(array $aBlocks)
{
$this->AddBlocksToContentArea(static::ENUM_CONTENT_AREA_TOOLBAR, $aBlocks);
return $this;
}
/**
* Remove the toolbar block identified by $sBlockId.
* Note that if no block with that ID exists, it will proceed silently.
@@ -295,7 +328,8 @@ class Panel extends UIContentBlock
*
* @return $this
*/
public function RemoveToolbarBlock(string $sBlockId) {
public function RemoveToolbarBlock(string $sBlockId)
{
$this->RemoveBlockFromContentArea(static::ENUM_CONTENT_AREA_TOOLBAR, $sBlockId);
return $this;