mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°2847 - FieldSet, MultiColumn, Tab for object details CSS
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user