N°3123 - Refactor Directories

This commit is contained in:
Eric
2020-12-02 13:18:01 +01:00
parent d1b12ee04b
commit 15aa9e508c
259 changed files with 862 additions and 869 deletions

View File

@@ -0,0 +1,131 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Layout\Dashboard;
use Combodo\iTop\Application\UI\Base\UIBlock;
class DashboardColumn extends UIBlock
{
public const BLOCK_CODE = 'ibo-dashboard-column';
public const HTML_TEMPLATE_REL_PATH = 'base/layouts/dashboard/column/layout';
/** @var UIBlock[] */
protected $aUIBlocks;
/** @var int */
protected $iColumnIndex;
/** @var int */
protected $iCellIndex;
/** @var bool */
protected $bEditMode;
/** @var bool */
protected $bLastRow;
public function __construct(bool $bEditMode = false, bool $bLastRow = false)
{
parent::__construct();
$this->aUIBlocks = [];
$this->iColumnIndex = 0;
$this->iCellIndex = 0;
$this->bEditMode = $bEditMode;
$this->bLastRow = $bLastRow;
}
/**
*
* @param UIBlock $oUIBlock
*
* @return DashboardColumn
*/
public function AddUIBlock(UIBlock $oUIBlock): DashboardColumn
{
$this->aUIBlocks[] = $oUIBlock;
return $this;
}
public function GetSubBlocks()
{
return $this->aUIBlocks;
}
/**
* @return int
*/
public function GetColumnIndex(): int
{
return $this->iColumnIndex;
}
/**
* @param int $iColumnIndex
*
* @return DashboardColumn
*/
public function SetColumnIndex(int $iColumnIndex): DashboardColumn
{
$this->iColumnIndex = $iColumnIndex;
return $this;
}
/**
* @return bool
*/
public function IsEditMode(): bool
{
return $this->bEditMode;
}
/**
* @param bool $bEditMode
*
* @return DashboardColumn
*/
public function SetEditMode(bool $bEditMode): DashboardColumn
{
$this->bEditMode = $bEditMode;
return $this;
}
/**
* @return int
*/
public function GetCellIndex(): int
{
return $this->iCellIndex;
}
/**
* @param int $iCellIndex
*
* @return DashboardColumn
*/
public function SetCellIndex(int $iCellIndex): DashboardColumn
{
$this->iCellIndex = $iCellIndex;
return $this;
}
/**
* @return bool
*/
public function IsLastRow(): bool
{
return $this->bLastRow;
}
/**
* @param bool $bLastRow
*
* @return DashboardColumn
*/
public function SetLastRow(bool $bLastRow): DashboardColumn
{
$this->bLastRow = $bLastRow;
return $this;
}
}

View File

@@ -0,0 +1,47 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Layout\Dashboard;
use Combodo\iTop\Application\UI\Base\UIBlock;
class DashboardLayout extends UIBlock
{
public const BLOCK_CODE = 'ibo-dashboard';
public const HTML_TEMPLATE_REL_PATH = 'base/layouts/dashboard/layout';
/** @var DashboardRow[] */
protected $aDashboardRows;
/** @var int */
protected $iRows;
public function __construct(?string $sId = null)
{
parent::__construct($sId);
$this->aDashboardRows = [];
$this->iRows = 0;
}
/**
*
* @param \Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardRow $oDashboardRow
*
* @return DashboardLayout
*/
public function AddDashboardRow(DashboardRow $oDashboardRow): DashboardLayout
{
$oDashboardRow->SetRowIndex($this->iRows);
$this->aDashboardRows[] = $oDashboardRow;
$this->iRows++;
return $this;
}
public function GetSubBlocks()
{
return $this->aDashboardRows;
}
}

View File

@@ -0,0 +1,69 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Layout\Dashboard;
use Combodo\iTop\Application\UI\Base\UIBlock;
class DashboardRow extends UIBlock
{
public const BLOCK_CODE = 'ibo-dashboard-row';
public const HTML_TEMPLATE_REL_PATH = 'base/layouts/dashboard/row/layout';
/** @var DashboardColumn[] */
protected $aDashboardColumns;
/** @var int */
protected $iRowIndex;
/** @var int */
protected $iCols;
public function __construct(?string $sId = null)
{
parent::__construct($sId);
$this->aDashboardColumns = [];
$this->iRowIndex = 0;
$this->iCols = 0;
}
/**
*
* @param \Combodo\iTop\Application\UI\Base\Layout\Dashboard\DashboardColumn $oDashboardColumn
*
* @return DashboardRow
*/
public function AddDashboardColumn(DashboardColumn $oDashboardColumn): DashboardRow
{
$oDashboardColumn->SetColumnIndex($this->iCols);
$this->aDashboardColumns[] = $oDashboardColumn;
$this->iCols++;
return $this;
}
public function GetSubBlocks()
{
return $this->aDashboardColumns;
}
/**
* @return int
*/
public function GetRowIndex(): int
{
return $this->iRowIndex;
}
/**
* @param int $iRowIndex
*
* @return DashboardRow
*/
public function SetRowIndex(int $iRowIndex): DashboardRow
{
$this->iRowIndex = $iRowIndex;
return $this;
}
}