N°2847 - FieldSet, MultiColumn, Tab for object details CSS

This commit is contained in:
Eric
2020-09-24 10:45:14 +02:00
parent 7bf473d2a3
commit ecd5a7aadf
13 changed files with 168 additions and 54 deletions

View File

@@ -25,12 +25,15 @@ class Title extends UIBlock
protected $sTitle;
/** @var int */
protected $iLevel;
/** @var string */
protected $sIconHtml;
public function __construct(string $sTitle = '', int $iLevel = 1, ?string $sId = null)
{
parent::__construct($sId);
$this->sTitle = $sTitle;
$this->iLevel = $iLevel;
$this->sIconHtml = null;
}
/**
@@ -48,4 +51,21 @@ class Title extends UIBlock
{
return $this->iLevel;
}
public function SetIcon(string $sIconHtml): self
{
$this->sIconHtml = $sIconHtml;
return $this;
}
public function GetIcon(): string
{
return $this->sIconHtml;
}
public function HasIcon(): string
{
return !is_null($this->sIconHtml);
}
}

View File

@@ -15,4 +15,12 @@ class TitleFactory
{
return new Title($sTitle, 1, $sId);
}
public static function MakeForObjectDetails(string $sClassName, string $sObjectName, string $sIconHtml, ?string $sId = null)
{
$oTitle = new TitleForObjectDetails($sClassName, $sObjectName, $sId);
$oTitle->SetIcon($sIconHtml);
return $oTitle;
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Component\Title;
class TitleForObjectDetails extends Title
{
public const HTML_TEMPLATE_REL_PATH = 'components/title/titleforobjectdetails';
/** @var string */
protected $sClassName;
/** @var string */
protected $sObjectName;
public function __construct(string $sClassName, string $sObjectName, ?string $sId = null)
{
parent::__construct('', 2, $sId);
$this->sClassName = $sClassName;
$this->sObjectName = $sObjectName;
}
/**
* @return string
*/
public function GetClassName(): string
{
return $this->sClassName;
}
/**
* @return string
*/
public function GetObjectName(): string
{
return $this->sObjectName;
}
}