* @package Combodo\iTop\Application\UI\Component\Alert * @since 2.8.0 */ class AlertFactory { /** * Make a basis Alert component * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeNeutral($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_NEUTRAL); } /** * Make an Alert component for successful messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeForSuccess($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_SUCCESS); } /** * Make an Alert component for warning messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeForWarning($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_WARNING); } /** * Make an Alert component for danger messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeForDanger($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_DANGER); } /** * Make an Alert component for failure messages * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeForFailure($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_FAILURE); } /** * Make an Alert component with primary color scheme * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeWithBrandingPrimaryColor($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_PRIMARY); } /** * Make an Alert component with secondary color scheme * * @param string $sTitle * @param string $sContent The raw HTML content, must be already sanitized * * @return \Combodo\iTop\Application\UI\Component\Alert\Alert */ public static function MakeWithBrandingSecondaryColor($sTitle, $sContent) { return new Alert($sTitle, $sContent, Alert::ENUM_COLOR_SECONDARY); } }