mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
N°2847 - Rework of MultiColumn / Column
- Remove unused HTML template - Move SCSS files to match convention - Move Column under MultiColumn to match convention (eg. ActivityPanel, PopoverMenu) - Update PHPDoc
This commit is contained in:
@@ -7,37 +7,63 @@
|
||||
namespace Combodo\iTop\Application\UI\Layout\MultiColumn;
|
||||
|
||||
|
||||
use Combodo\iTop\Application\UI\Layout\Column\Column;
|
||||
use Combodo\iTop\Application\UI\Layout\MultiColumn\Column\Column;
|
||||
use Combodo\iTop\Application\UI\UIBlock;
|
||||
|
||||
/**
|
||||
* Class MultiColumn
|
||||
*
|
||||
* @package Combodo\iTop\Application\UI\Layout\MultiColumn
|
||||
* @internal
|
||||
* @since 2.8.0
|
||||
*/
|
||||
class MultiColumn extends UIBlock
|
||||
{
|
||||
class MultiColumn extends UIBlock {
|
||||
// Overloaded constants
|
||||
public const BLOCK_CODE = 'ibo-multicolumn';
|
||||
public const HTML_TEMPLATE_REL_PATH = 'layouts/multicolumn/layout';
|
||||
|
||||
/** @var array */
|
||||
/** @var \Combodo\iTop\Application\UI\Layout\MultiColumn\Column\Column[] */
|
||||
protected $aColumns;
|
||||
|
||||
public function __construct(?string $sId = null)
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function __construct(?string $sId = null) {
|
||||
parent::__construct($sId);
|
||||
$this->aColumns = [];
|
||||
}
|
||||
|
||||
public function AddColumn(Column $oColumn): self
|
||||
{
|
||||
/**
|
||||
* @param \Combodo\iTop\Application\UI\Layout\MultiColumn\Column\Column $oColumn
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function AddColumn(Column $oColumn) {
|
||||
$this->aColumns[] = $oColumn;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetSubBlocks()
|
||||
{
|
||||
/**
|
||||
* Remove the column of $iIndex index.
|
||||
* Note that if the column does not exists, it proceeds silently.
|
||||
*
|
||||
* @param int $iIndex
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function RemoveColumn(int $iIndex) {
|
||||
if (isset($this->aColumns[$iIndex])) {
|
||||
unset($this->aColumns[$iIndex]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function GetSubBlocks() {
|
||||
return $this->aColumns;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user