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,65 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTable;
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow\FormTableRow;
use Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\StaticTable;
use Combodo\iTop\Application\UI\Base\iUIBlock;
/**
* Class FormTable
*
* @package Combodo\iTop\Application\UI\Base\Component\FormTable
*/
class FormTable extends StaticTable
{
// Overloaded constants
public const BLOCK_CODE = 'ibo-formtable';
public const HTML_TEMPLATE_REL_PATH = 'base/components/datatable/static/formtable/layout';
public const JS_TEMPLATE_REL_PATH = 'base/components/datatable/static/formtable/layout';
/** @var string */
private $sRef;
/** @var iUIBlock[] */
private $aRows;
public function __construct(string $sRef, string $sContainerCSSClass = '')
{
parent::__construct("dt_{$sRef}", $sContainerCSSClass);
$this->SetRef($sRef);
$this->aRows = [];
}
/**
* @return string
*/
public function GetRef(): string
{
return $this->sRef;
}
/**
* @param string $sRef
*/
public function SetRef(string $sRef): void
{
$this->sRef = $sRef;
}
public function GetRows(): array
{
return $this->aRows;
}
public function AddRow(FormTableRow $oRow): self
{
$this->aRows[] = $oRow;
return $this;
}
}

View File

@@ -0,0 +1,124 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable\FormTableRow;
use Combodo\iTop\Application\UI\Base\UIBlock;
/**
* Class FormTableRow
*
* @package Combodo\iTop\Application\UI\Base\Component\FormTableRow
*/
class FormTableRow extends UIBlock
{
// Overloaded constants
public const BLOCK_CODE = 'ibo-formtablerow';
public const HTML_TEMPLATE_REL_PATH = 'base/components/datatable/static/formtablerow/layout';
public const JS_TEMPLATE_REL_PATH = 'base/components/datatable/static/formtablerow/layout';
/** @var string */
private $sRef;
/** @var int */
private $iRowId;
/**
* @var array
* [
* 'entry name' => [
* 'description' => tooltip,
* 'label' => label to display,
* 'class' => cell CSS class,
* 'metadata' => [key => value] transformed into data-key="value"
* ], ...
* ]
*/
private $aColumns;
/**
* @var array
* [
* 'entry name' => [
* 'value_html' => value to display in the cell,
* 'value_raw' => real value put into data-value-raw
* ], ...
* ]
*/
private $aData;
public function __construct(string $sRef, array $aColumns, array $aData, int $iRowId)
{
parent::__construct();
$this->SetRef($sRef);
$this->SetColumns($aColumns);
$this->SetData($aData);
$this->SetRowId($iRowId);
}
/**
* @return string
*/
public function GetRef(): string
{
return $this->sRef;
}
/**
* @param string $sRef
*/
public function SetRef(string $sRef): void
{
$this->sRef = $sRef;
}
/**
* @return array
*/
public function GetColumns(): array
{
return $this->aColumns;
}
/**
* @param array $aColumns
*/
public function SetColumns(array $aColumns): void
{
$this->aColumns = $aColumns;
}
/**
* @return array
*/
public function GetData(): array
{
return $this->aData;
}
/**
* @param array $aData
*/
public function SetData(array $aData): void
{
$this->aData = $aData;
}
/**
* @return int
*/
public function GetRowId(): int
{
return $this->iRowId;
}
/**
* @param int $iRowId
*/
public function SetRowId(int $iRowId): void
{
$this->iRowId = $iRowId;
}
}

View File

@@ -0,0 +1,83 @@
<?php
namespace Combodo\iTop\Application\UI\Base\Component\DataTable\StaticTable;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Tables with static data
* Class StaticTable
*/
class StaticTable extends UIContentBlock
{
// Overloaded constants
public const BLOCK_CODE = 'ibo-datatable';
public const HTML_TEMPLATE_REL_PATH = 'base/components/datatable/static/layout';
public const JS_TEMPLATE_REL_PATH = 'base/components/datatable/static/layout';
/**
* @var array of 'entry name' => [
* 'description' => tooltip,
* 'label' => label to display,
* 'class' => cell CSS class,
* 'metadata' => [key => value] transformed into data-key="value"
* ]
*/
private $aColumns;
/**
* @var array of [
* '@class' => css class of the row,
* 'entry name' => [
* 'value_html' => value to display in the cell,
* 'value_raw' => real value put into data-value-raw
* ], ...
* ]
*/
private $aData;
public function __construct(string $sId = null, string $sContainerCSSClass = '')
{
parent::__construct($sId, $sContainerCSSClass);
$this->aColumns = [];
$this->aData = [];
}
/**
* @return array
*/
public function GetColumns(): array
{
return $this->aColumns;
}
/**
* @param array $aColumns
*/
public function SetColumns(array $aColumns): void
{
$this->aColumns = $aColumns;
}
/**
* @return array
*/
public function GetData(): array
{
return $this->aData;
}
/**
* @param array $aData
*/
public function SetData(array $aData): void
{
$this->aData = $aData;
}
}