diff --git a/sources/application/UI/Base/Component/Alert/Alert.php b/sources/application/UI/Base/Component/Alert/Alert.php index b6f5a4552..a3ef464aa 100644 --- a/sources/application/UI/Base/Component/Alert/Alert.php +++ b/sources/application/UI/Base/Component/Alert/Alert.php @@ -84,6 +84,8 @@ class Alert extends UIBlock protected $sContent; /** @var string $sColor */ protected $sColor; + /** @var bool */ + protected $bIsOpenedByDefault; /** * Alert constructor. @@ -92,12 +94,16 @@ class Alert extends UIBlock * @param string $sContent * @param string $sColor * @param string|null $sId + * @param bool|null $bIsOpenedByDefault */ - public function __construct(string $sTitle = '', string $sContent = '', string $sColor = self::DEFAULT_COLOR, ?string $sId = null) + public function __construct(string $sTitle = '', string $sContent = '', string $sColor = self::DEFAULT_COLOR, ?string $sId = null, + ?bool $bIsOpenedByDefault = true + ) { $this->sTitle = $sTitle; $this->sContent = $sContent; $this->sColor = $sColor; + $this->bIsOpenedByDefault = $bIsOpenedByDefault; parent::__construct($sId); } @@ -148,7 +154,7 @@ class Alert extends UIBlock /** * @return string */ - public function GetColor() + public function GetColor(): string { return $this->sColor; } @@ -163,4 +169,16 @@ class Alert extends UIBlock return $this; } + + public function IsOpenedByDefault() + { + return $this->bIsOpenedByDefault; + } + + public function SetOpenedByDefault(bool $bIsOpenedByDefault): Alert + { + $this->bIsOpenedByDefault = $bIsOpenedByDefault; + + return $this; + } } \ No newline at end of file diff --git a/templates/base/components/alert/layout.html.twig b/templates/base/components/alert/layout.html.twig index f0afa2a6a..e978d22c9 100644 --- a/templates/base/components/alert/layout.html.twig +++ b/templates/base/components/alert/layout.html.twig @@ -1,4 +1,4 @@ -
+