N°8955 New UIBlocks for setup

This commit is contained in:
Timothee
2026-01-15 11:33:17 +01:00
parent 95b8b8ca32
commit 8b19d7e1d0
13 changed files with 315 additions and 45 deletions

View File

@@ -1,20 +1,43 @@
<?php
namespace Combodo\iTop\Application\UI\Base\Component\Badge;
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
use Dict;
use utils;
class BadgeUIBlockFactory extends AbstractUIBlockFactory
class BadgeUIBlockFactory extends AbstractUIBlockFactory
{
/** @inheritDoc */
public const TWIG_TAG_NAME = 'UIBadge';
/** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Badge::class;
public static function MakeNeutral(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_NEUTRAL,$sTooltip, $sId);
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_NEUTRAL, $sTooltip, $sId);
}
}
public static function MakeGrey(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_BLUE_GREY, $sTooltip, $sId);
}
public static function MakeRed(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_RED, $sTooltip, $sId);
}
public static function MakeCyan(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_CYAN, $sTooltip, $sId);
}
public static function MakeGreen(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_GREEN, $sTooltip, $sId);
}
public static function MakeOrange(string $sLabel, string $sTooltip = '', ?string $sId = null)
{
return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_ORANGE, $sTooltip, $sId);
}
}