* @package Combodo\iTop\Application\UI\Base\Component\Alert * @since 3.0.0 * * @link /test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-alerts to see live examples */ class AlertUIBlockFactory extends AbstractUIBlockFactory { public const TWIG_TAG_NAME = 'UIAlert'; public const UI_BLOCK_CLASS_NAME = Alert::class; /** * Make a basis Alert component * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeNeutral(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_NEUTRAL, $sId); } /** * Make an Alert component for informational messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeForInformation(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_INFORMATION, $sId); } /** * Make an Alert component for successful messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeForSuccess(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_SUCCESS, $sId); } /** * Make an Alert component for warning messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeForWarning(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_WARNING, $sId); } /** * Make an Alert component for danger messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeForDanger(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_DANGER, $sId); } /** * Make an Alert component for failure messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeForFailure(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_FAILURE, $sId); } /** * Make an Alert component with primary color scheme * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeWithBrandingPrimaryColor(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_PRIMARY, $sId); } /** * Make an Alert component with secondary color scheme * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * @param string|null $sId * * @return \Combodo\iTop\Application\UI\Base\Component\Alert\Alert */ public static function MakeWithBrandingSecondaryColor(string $sTitle = '', string $sContent = '', ?string $sId = null) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_SECONDARY, $sId); } }