ILIAS  release_7 Revision v7.30-3-g800a261c036
SystemInfo.php
Go to the documentation of this file.
1<?php
2
4
11
17{
20
24 protected $head_line;
25
30
34 protected $dismiss_action = null;
35
40
44 protected $close_signal;
45
50
57 public function __construct(SignalGeneratorInterface $signal_generator, string $head_line, string $information_text)
58 {
59 $this->signal_generator = $signal_generator;
60 $this->head_line = $head_line;
61 $this->information_text = $information_text;
62 $this->initSignals();
63 }
64
65 protected function initSignals() : void
66 {
67 $this->close_signal = $this->signal_generator->create();
68 }
69
70 public function getHeadLine() : string
71 {
72 return $this->head_line;
73 }
74
75 public function getInformationText() : string
76 {
77 return $this->information_text;
78 }
79
80 public function isDismissable() : bool
81 {
82 return !is_null($this->dismiss_action);
83 }
84
85 public function getDismissAction() : URI
86 {
87 return $this->dismiss_action;
88 }
89
90 public function withDismissAction(?URI $uri) : \ILIAS\UI\Component\MainControls\SystemInfo
91 {
92 $clone = clone $this;
93 $clone->dismiss_action = $uri;
94 return $clone;
95 }
96
97 public function withDenotation(string $denotation) : \ILIAS\UI\Component\MainControls\SystemInfo
98 {
99 if (
100 $denotation !== MainControls\SystemInfo::DENOTATION_NEUTRAL
101 && $denotation !== MainControls\SystemInfo::DENOTATION_IMPORTANT
102 && $denotation !== MainControls\SystemInfo::DENOTATION_BREAKING
103 ) {
104 throw new \InvalidArgumentException("Unknown denotation '$denotation'");
105 }
106
107 $clone = clone $this;
108 $clone->denotation = $denotation;
109 return $clone;
110 }
111
112 public function getDenotation() : string
113 {
114 return $this->denotation;
115 }
116
120 public function getCloseSignal() : Signal
121 {
122 return $this->close_signal;
123 }
124
128 public function withResetSignals()
129 {
130 $clone = clone $this;
131 $clone->initSignals();
132 return $clone;
133 }
134}
An exception for terminatinating execution or to throw for unit testing.
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
__construct(SignalGeneratorInterface $signal_generator, string $head_line, string $information_text)
SystemInfo constructor.
Definition: SystemInfo.php:57
A component is the most general form of an entity in the UI.
Definition: Component.php:14
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
trait ComponentHelper
Provides common functionality for component implementations.
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.