ILIAS  release_7 Revision v7.30-3-g800a261c036
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
11
13{
16
20 protected $show_signal;
21
25 protected $close_signal;
26
30 protected $toggle_signal;
31
35 private $headline;
36
40 private $subheadline;
41
45 private $action;
46
50 private $important_fields = [];
51
55 private $content;
56
61
65 private $further_fields = [];
66
70 private $data;
71
76
78 {
79 $this->signal_generator = $signal_generator;
80 $this->initSignals();
81 }
82
86 public function withResetSignals()
87 {
88 $clone = clone $this;
89 $clone->initSignals();
90 return $clone;
91 }
92
96 protected function initSignals()
97 {
98 $this->show_signal = $this->signal_generator->create();
99 $this->close_signal = $this->signal_generator->create();
100 $this->toggle_signal = $this->signal_generator->create();
101 }
102
106 public function getShowSignal()
107 {
108 return $this->show_signal;
109 }
110
114 public function getCloseSignal()
115 {
116 return $this->close_signal;
117 }
118
119
123 public function getToggleSignal()
124 {
126 }
127
128
132 public function withHeadline($headline)
133 {
134 $this->checkStringArg("string", $headline);
135 $clone = clone $this;
136 $clone->headline = $headline;
137 return $clone;
138 }
139
143 public function getHeadline()
144 {
145 return $this->headline;
146 }
147
152 {
153 $this->checkStringArg("string", $subheadline);
154 $clone = clone $this;
155 $clone->subheadline = $subheadline;
156 return $clone;
157 }
158
162 public function getSubheadline()
163 {
164 return $this->subheadline;
165 }
166
170 public function withImportantFields(array $fields)
171 {
172 $clone = clone $this;
173 $clone->important_fields = $fields;
174 return $clone;
175 }
176
180 public function getImportantFields()
181 {
183 }
184
185
189 public function withContent(\ILIAS\UI\Component\Listing\Descriptive $content)
190 {
191 $clone = clone $this;
192 $clone->content = $content;
193 return $clone;
194 }
195
199 public function getContent()
200 {
201 return $this->content;
202 }
203
204
209 {
210 $this->checkStringArg("string", $headline);
211 $clone = clone $this;
212 $clone->further_fields_headline = $headline;
213 return $clone;
214 }
215
219 public function getFurtherFieldsHeadline()
220 {
222 }
223
227 public function withFurtherFields(array $fields)
228 {
229 $clone = clone $this;
230 $clone->further_fields = $fields;
231 return $clone;
232 }
233
237 public function getFurtherFields()
238 {
240 }
241
242
246 public function withAction($action)
247 {
248 $check =
249 is_null($action)
250 || $action instanceof \ILIAS\UI\Component\Button\Button
251 || $action instanceof \ILIAS\UI\Component\Dropdown\Dropdown;
252
253 $expected =
254 " NULL or " .
255 " \ILIAS\UI\Component\Button\Button or " .
256 " \ILIAS\UI\Component\ropdown\Dropdown";
257
258 $this->checkArg("action", $check, $this->wrongTypeMessage($expected, $action));
259 $clone = clone $this;
260 $clone->action = $action;
261 return $clone;
262 }
263
267 public function getAction()
268 {
269 return $this->action;
270 }
271}
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)
clone(int $target_parent_obj_id)
A component is the most general form of an entity in the UI.
Definition: Component.php:14
initSignals()
Init the default signals plus extra signals like Replace.
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 ChatMainBarProvider \MainMenu\Provider.
Class Factory.