ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PresentationRow.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
10
12{
15
19 protected $show_signal;
20
24 protected $close_signal;
25
29 protected $toggle_signal;
30
34 private $headline;
35
39 private $subheadline;
40
44 private $action;
45
50
54 private $content;
55
60
65
69 private $data;
70
71 public function __construct(SignalGeneratorInterface $signal_generator)
72 {
73 $this->signal_generator = $signal_generator;
74 $this->actions = null;
75 $this->initSignals();
76 }
77
81 public function withResetSignals()
82 {
83 $clone = clone $this;
84 $clone->initSignals();
85 return $clone;
86 }
87
91 protected function initSignals()
92 {
93 $this->show_signal = $this->signal_generator->create();
94 $this->close_signal = $this->signal_generator->create();
95 $this->toggle_signal = $this->signal_generator->create();
96 }
97
101 public function getShowSignal()
102 {
103 return $this->show_signal;
104 }
105
109 public function getCloseSignal()
110 {
111 return $this->close_signal;
112 }
113
114
118 public function getToggleSignal()
119 {
121 }
122
123
127 public function withHeadline($headline)
128 {
129 $this->checkStringArg("string", $headline);
130 $clone = clone $this;
131 $clone->headline = $headline;
132 return $clone;
133 }
134
138 public function getHeadline()
139 {
140 return $this->headline;
141 }
142
147 {
148 $this->checkStringArg("string", $subheadline);
149 $clone = clone $this;
150 $clone->subheadline = $subheadline;
151 return $clone;
152 }
153
157 public function getSubheadline()
158 {
159 return $this->subheadline;
160 }
161
165 public function withImportantFields(array $fields)
166 {
167 $clone = clone $this;
168 $clone->important_fields = $fields;
169 return $clone;
170 }
171
175 public function getImportantFields()
176 {
178 }
179
180
184 public function withContent(\ILIAS\UI\Component\Listing\Descriptive $content)
185 {
186 $clone = clone $this;
187 $clone->content = $content;
188 return $clone;
189 }
190
194 public function getContent()
195 {
196 return $this->content;
197 }
198
199
204 {
205 $this->checkStringArg("string", $headline);
206 $clone = clone $this;
207 $clone->further_fields_headline = $headline;
208 return $clone;
209 }
210
214 public function getFurtherFieldsHeadline()
215 {
217 }
218
222 public function withFurtherFields(array $fields)
223 {
224 $clone = clone $this;
225 $clone->further_fields = $fields;
226 return $clone;
227 }
228
232 public function getFurtherFields()
233 {
235 }
236
237
241 public function withAction($action)
242 {
243 $check =
244 is_null($action)
245 || $action instanceof \ILIAS\UI\Component\Button\Button
246 || $action instanceof \ILIAS\UI\Component\Dropdown\Dropdown;
247
248 $expected =
249 " NULL or " .
250 " \ILIAS\UI\Component\Button\Button or " .
251 " \ILIAS\UI\Component\ropdown\Dropdown";
252
253 $this->checkArg("action", $check, $this->wrongTypeMessage($expected, $action));
254 $clone = clone $this;
255 $clone->action = $action;
256 return $clone;
257 }
258
262 public function getAction()
263 {
264 return $this->action;
265 }
266}
An exception for terminatinating execution or to throw for unit testing.
initSignals()
Set the signals for this component.
__construct(SignalGeneratorInterface $signal_generator)
withContent(\ILIAS\UI\Component\Listing\Descriptive $content)
A component is the most general form of an entity in the UI.
Definition: Component.php:14
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
checkArg($which, $check, $message)
/** Throw an InvalidArgumentException containing the message if $check is false.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
trait ComponentHelper
Provides common functionality for component implementations.
Class BaseForm.
Class Factory.