ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 {
14  use ComponentHelper;
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 
75  protected $signal_generator;
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  {
125  return $this->toggle_signal;
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 
151  public function withSubheadline($subheadline)
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  {
239  return $this->further_fields;
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 }
initSignals()
Set the signals for this component.
withSubheadline($subheadline)
Get a row like this with the given subheadline.
Class Factory.
checkArg($which, $check, $message)
/** Throw an InvalidArgumentException containing the message if $check is false.
Class ChatMainBarProvider .
withFurtherFields(array $fields)
Get a row like this with the record-fields and labels to be shown in the list of the expanded row...
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
withResetSignals()
Get a component like this but reset (regenerate) its signals.$this
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
withFurtherFieldsHeadline($headline)
Get a row like this with a headline for the field-list in the expanded row.
getCloseSignal()
Get the signal to collapse the row.Signal
This describes a Row used in Presentation Table.
withContent(\ILIAS\UI\Component\Listing\Descriptive $content)
Get a row like this with a descriptive listing as content.
getShowSignal()
Get the signal to expand the row.Signal
withHeadline($headline)
Get a row like this with the given headline.
withImportantFields(array $fields)
Get a row like this with the record-fields and labels to be shown in the collapsed row...
getToggleSignal()
Get the signal to toggle (expand/collapse) the row.Signal
withAction($action)
Get a row like this with a button or a dropdown for actions in the expanded row.
__construct(SignalGeneratorInterface $signal_generator)