mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
PHP CS-Fixer
This commit is contained in:
@@ -61,4 +61,4 @@ class DashboardGrid extends UIBlock
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ class DashboardGridSlot extends UIBlock
|
||||
$this->iHeight = random_int(1, 4) || $iHeight;
|
||||
}
|
||||
|
||||
|
||||
public function GetSubBlocks(): array
|
||||
{
|
||||
return [$this->oUIBlock];
|
||||
|
||||
@@ -13,6 +13,7 @@ use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockF
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
use Dict;
|
||||
|
||||
use function Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
|
||||
|
||||
// TODO 3.3 Remove old dashboard methods, make dict entries for elements, etc
|
||||
@@ -54,7 +55,8 @@ class DashboardLayout extends UIBlock
|
||||
$this->oButtonsToolbar = $this->MakeButtonsToolbar();
|
||||
}
|
||||
|
||||
public function MakeTitleInput() {
|
||||
public function MakeTitleInput()
|
||||
{
|
||||
$oTitleInput = new \Combodo\iTop\Application\UI\Base\Component\Input\Input();
|
||||
$oTitleInput->SetName('dashboard_title');
|
||||
$oTitleInput->SetType('text');
|
||||
@@ -63,7 +65,8 @@ class DashboardLayout extends UIBlock
|
||||
return $oTitleInput;
|
||||
}
|
||||
|
||||
public function MakeRefreshInput() {
|
||||
public function MakeRefreshInput()
|
||||
{
|
||||
$oRefreshInput = \Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectUIBlockFactory::MakeForSelect('refresh_interval');
|
||||
$aRefreshRateOptions = [
|
||||
['value' => '0', 'label' => 'No auto-refresh'],
|
||||
@@ -82,7 +85,8 @@ class DashboardLayout extends UIBlock
|
||||
|
||||
return $oRefreshInput;
|
||||
}
|
||||
public function MakeButtonsToolbar() {
|
||||
public function MakeButtonsToolbar()
|
||||
{
|
||||
$oContainer = new UIContentBlock(null, ['ibo-dashboard--buttons-toolbar']);
|
||||
$oCancelButton = ButtonUIBlockFactory::MakeForCancel(Dict::S('UI:Button:Cancel'), 'cancel', 'cancel');
|
||||
$oSaveButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('UI:Button:Save'), 'save', 'save');
|
||||
@@ -162,13 +166,15 @@ class DashboardLayout extends UIBlock
|
||||
return $this->aDashboardRows;
|
||||
}
|
||||
|
||||
public function SetGrid(DashboardGrid $oDashboardGrid) {
|
||||
public function SetGrid(DashboardGrid $oDashboardGrid)
|
||||
{
|
||||
$this->oDashboardGrid = $oDashboardGrid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetGrid() {
|
||||
public function GetGrid()
|
||||
{
|
||||
return $this->oDashboardGrid;
|
||||
}
|
||||
|
||||
@@ -177,11 +183,13 @@ class DashboardLayout extends UIBlock
|
||||
return $this->oTitleInput;
|
||||
}
|
||||
|
||||
public function GetRefreshInput() {
|
||||
public function GetRefreshInput()
|
||||
{
|
||||
return $this->oRefreshInput;
|
||||
}
|
||||
|
||||
public function GetButtonsToolbar() {
|
||||
public function GetButtonsToolbar()
|
||||
{
|
||||
return $this->oButtonsToolbar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ namespace Combodo\iTop\Application\UI\Base\Layout\DashletPanel;
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
use utils;
|
||||
|
||||
class DashletEntry extends UIBlock {
|
||||
class DashletEntry extends UIBlock
|
||||
{
|
||||
public const BLOCK_CODE = 'ibo-dashlet-entry';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/layouts/dashlet-panel/dashlet-entry';
|
||||
|
||||
@@ -18,7 +19,6 @@ class DashletEntry extends UIBlock {
|
||||
protected $sDashletPreferredWidth;
|
||||
protected $sDashletPreferredHeight;
|
||||
|
||||
|
||||
public function __construct(string $sDashletClass, string $sDashletLabel, string $sDashletDescription, string $sDashletIconRelUrl, ?string $sId = null)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
@@ -159,5 +159,4 @@ class DashletEntry extends UIBlock {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ namespace Combodo\iTop\Application\UI\Base\Layout\DashletPanel;
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
use Dashlet;
|
||||
|
||||
class DashletPanel extends UIBlock {
|
||||
class DashletPanel extends UIBlock
|
||||
{
|
||||
public const BLOCK_CODE = 'ibo-dashlet-panel';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/layouts/dashlet-panel/layout';
|
||||
public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/layouts/dashlet-panel/layout';
|
||||
@@ -19,17 +20,20 @@ class DashletPanel extends UIBlock {
|
||||
$this->AddDataAttribute('role', static::BLOCK_CODE);
|
||||
}
|
||||
|
||||
public function AddDashletEntry(DashletEntry $oDashletEntry) {
|
||||
public function AddDashletEntry(DashletEntry $oDashletEntry)
|
||||
{
|
||||
$this->aDashletsEntries[] = $oDashletEntry;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetDashletEntries() : array {
|
||||
public function GetDashletEntries(): array
|
||||
{
|
||||
return $this->aDashletsEntries;
|
||||
}
|
||||
|
||||
public function SetDashletEntries(array $aDashletEntries) {
|
||||
public function SetDashletEntries(array $aDashletEntries)
|
||||
{
|
||||
$this->aDashletsEntries = $aDashletEntries;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Layout\DashletPanel;
|
||||
|
||||
|
||||
use Combodo\iTop\Service\Dashboard\DashletService;
|
||||
|
||||
class DashletPanelFactory {
|
||||
class DashletPanelFactory
|
||||
{
|
||||
public static function MakeForDashboardEditor(string $sId = null): DashletPanel
|
||||
{
|
||||
$oDashletPanel = new DashletPanel($sId);
|
||||
@@ -15,16 +15,16 @@ class DashletPanelFactory {
|
||||
foreach ($aAvailableDashlets as $sDashletClass => $aDashletInformation) {
|
||||
$oDashletEntry = new DashletEntry($sDashletClass, $aDashletInformation['label'], $aDashletInformation['description'], $aDashletInformation['icon']);
|
||||
|
||||
if(isset($aDashletInformation['min_width'])) {
|
||||
if (isset($aDashletInformation['min_width'])) {
|
||||
$oDashletEntry->SetDashletMinWidth($aDashletInformation['min_width']);
|
||||
}
|
||||
if(isset($aDashletInformation['min_height'])) {
|
||||
if (isset($aDashletInformation['min_height'])) {
|
||||
$oDashletEntry->SetDashletMinHeight($aDashletInformation['min_height']);
|
||||
}
|
||||
if(isset($aDashletInformation['preferred_width'])) {
|
||||
if (isset($aDashletInformation['preferred_width'])) {
|
||||
$oDashletEntry->SetDashletPreferredWidth($aDashletInformation['preferred_width']);
|
||||
}
|
||||
if(isset($aDashletInformation['preferred_height'])) {
|
||||
if (isset($aDashletInformation['preferred_height'])) {
|
||||
$oDashletEntry->SetDashletPreferredHeight($aDashletInformation['preferred_height']);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ class PageContentFactory
|
||||
return $oLayout;
|
||||
}
|
||||
|
||||
public static function MakeForDashboard() {
|
||||
public static function MakeForDashboard()
|
||||
{
|
||||
$oLayout = new PageContentWithSideContent();
|
||||
|
||||
// TODO 3.3 Add dashboard specific blocks
|
||||
|
||||
Reference in New Issue
Block a user