mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°3581 - Dashlet: Rename Badge block to Pill as it can contain just a simple text and to avoid confusion with the DashletBadge
This commit is contained in:
51
sources/application/UI/Base/Component/Pill/Pill.php
Normal file
51
sources/application/UI/Base/Component/Pill/Pill.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\Pill;
|
||||
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||
|
||||
/**
|
||||
* Class Pill
|
||||
*
|
||||
* @internal
|
||||
* @author Eric Espie <eric.espie@combodo.com>
|
||||
* @since 3.0.0
|
||||
* @package Combodo\iTop\Application\UI\Base\Component\Pill
|
||||
*/
|
||||
class Pill extends UIContentBlock
|
||||
{
|
||||
/** @var string */
|
||||
protected $sColor;
|
||||
|
||||
public function __construct(string $sColor)
|
||||
{
|
||||
parent::__construct(null, ["ibo-pill ibo-pill-is-{$sColor}"]);
|
||||
$this->SetColor($sColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GetColor(): ?string
|
||||
{
|
||||
return $this->sColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sColor
|
||||
*
|
||||
* @return Pill
|
||||
*/
|
||||
public function SetColor(string $sColor): Pill
|
||||
{
|
||||
$this->sColor = $sColor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user