N°3914 - Popover menu: Add method to add several items in a section at once

This commit is contained in:
Molkobain
2021-05-04 11:45:09 +02:00
parent 11278d7ba5
commit 3c89313795

View File

@@ -461,6 +461,24 @@ class PopoverMenu extends UIBlock
return $this;
}
/**
* Add all $aItems to the $sSectionId after the existing items
*
* @param string $sSectionId
* @param PopoverMenuItem[] $aItems
*
* @return $this
* @throws \Exception
*/
public function AddItems(string $sSectionId, array $aItems)
{
foreach($aItems as $oItem){
$this->AddItem($sSectionId, $oItem);
}
return $this;
}
/**
* Set all $aItems at once in the $sSectionId, overwriting all existing.
*