mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
Add features to Spinner block
This commit is contained in:
@@ -19,9 +19,71 @@ class Spinner extends UIBlock
|
||||
// Overloaded constants
|
||||
public const BLOCK_CODE = 'ibo-spinner';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/spinner/layout';
|
||||
|
||||
/* @var string Display size for inline element, rather small */
|
||||
public const ENUM_SPINNER_SIZE_INLINE = 'inline';
|
||||
/* @var string Display size for small element, displayed in a column */
|
||||
public const ENUM_SPINNER_SIZE_SMALL = 'small';
|
||||
/* @var string Display size for medium element, displayed in a column */
|
||||
public const ENUM_SPINNER_SIZE_MEDIUM = 'medium';
|
||||
|
||||
public function __construct(?string $sId = null)
|
||||
/* @var string Display size for large element, displayed in a column */
|
||||
public const ENUM_SPINNER_SIZE_LARGE = 'large';
|
||||
/* @var string Default display size */
|
||||
public const ENUM_SPINNER_SIZE_DEFAULT = self::ENUM_SPINNER_SIZE_INLINE;
|
||||
|
||||
/* @var string */
|
||||
private $sDescription = '';
|
||||
/* @var string */
|
||||
private $sSize = self::ENUM_SPINNER_SIZE_DEFAULT;
|
||||
|
||||
public function __construct(?string $sId = null, $sDescription = '')
|
||||
{
|
||||
parent::__construct($sId);
|
||||
$this->sDescription = $sDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GetDescription(): string
|
||||
{
|
||||
return $this->sDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sDescription
|
||||
* @return $this
|
||||
*/
|
||||
public function SetDescription($sDescription)
|
||||
{
|
||||
$this->sDescription = $sDescription;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function HasDescription(): bool
|
||||
{
|
||||
return $this->sDescription !== '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GetSize(): string
|
||||
{
|
||||
return $this->sSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sSize
|
||||
* @return $this
|
||||
*/
|
||||
public function SetSize(string $sSize)
|
||||
{
|
||||
$this->sSize = $sSize;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user