ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SystemInfo.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\Data\URI;
30 
36 {
37  use ComponentHelper;
39 
40  protected string $head_line;
41  protected string $information_text;
42  protected ?URI $dismiss_action = null;
43  protected string $denotation = self::DENOTATION_NEUTRAL;
44  protected Signal $close_signal;
46 
47  public function __construct(SignalGeneratorInterface $signal_generator, string $head_line, string $information_text)
48  {
49  $this->signal_generator = $signal_generator;
50  $this->head_line = $head_line;
51  $this->information_text = $information_text;
52  $this->initSignals();
53  }
54 
55  protected function initSignals(): void
56  {
57  $this->close_signal = $this->signal_generator->create();
58  }
59 
60  public function getHeadLine(): string
61  {
62  return $this->head_line;
63  }
64 
65  public function getInformationText(): string
66  {
68  }
69 
70  public function isDismissable(): bool
71  {
72  return !is_null($this->dismiss_action);
73  }
74 
75  public function getDismissAction(): URI
76  {
77  return $this->dismiss_action;
78  }
79 
80  public function withDismissAction(?URI $uri): MainControls\SystemInfo
81  {
82  $clone = clone $this;
83  $clone->dismiss_action = $uri;
84  return $clone;
85  }
86 
87  public function withDenotation(string $denotation): MainControls\SystemInfo
88  {
89  if (
90  $denotation !== MainControls\SystemInfo::DENOTATION_NEUTRAL
91  && $denotation !== MainControls\SystemInfo::DENOTATION_IMPORTANT
92  && $denotation !== MainControls\SystemInfo::DENOTATION_BREAKING
93  ) {
94  throw new InvalidArgumentException("Unknown denotation '$denotation'");
95  }
96 
97  $clone = clone $this;
98  $clone->denotation = $denotation;
99  return $clone;
100  }
101 
102  public function getDenotation(): string
103  {
104  return $this->denotation;
105  }
106 
107  public function getCloseSignal(): Signal
108  {
109  return $this->close_signal;
110  }
111 
115  public function withResetSignals(): SystemInfo
116  {
117  $clone = clone $this;
118  $clone->initSignals();
119  return $clone;
120  }
121 }
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(SignalGeneratorInterface $signal_generator, string $head_line, string $information_text)
Definition: SystemInfo.php:47