mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 21:18:46 +02:00
N°3123 - Refactor Directories
This commit is contained in:
131
sources/application/UI/Base/Layout/Dashboard/DashboardColumn.php
Normal file
131
sources/application/UI/Base/Layout/Dashboard/DashboardColumn.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user