ILIAS  release_8 Revision v8.23
PresentationRow.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 
33 {
34  use ComponentHelper;
36 
40  private $action = null;
41 
42  protected Signal $show_signal;
43  protected Signal $close_signal;
45  private ?string $headline = null;
46  private ?string $subheadline = null;
47  private array $important_fields = [];
49  private ?string $further_fields_headline = null;
50  private array $further_fields = [];
51  private array $data;
53  protected string $table_id;
54 
55  public function __construct(
56  SignalGeneratorInterface $signal_generator,
57  string $table_id
58  ) {
59  $this->signal_generator = $signal_generator;
60  $this->table_id = $table_id;
61  $this->initSignals();
62  }
63 
67  public function withResetSignals(): T\PresentationRow
68  {
69  $clone = clone $this;
70  $clone->initSignals();
71  return $clone;
72  }
73 
77  protected function initSignals(): void
78  {
79  $this->show_signal = $this->signal_generator->create();
80  $this->close_signal = $this->signal_generator->create();
81  $this->toggle_signal = $this->signal_generator->create();
82  }
83 
87  public function getShowSignal(): Signal
88  {
89  return $this->show_signal;
90  }
91 
95  public function getCloseSignal(): Signal
96  {
97  return $this->close_signal;
98  }
99 
100 
104  public function getToggleSignal(): Signal
105  {
106  return $this->toggle_signal;
107  }
108 
109 
113  public function withHeadline($headline): T\PresentationRow
114  {
115  $this->checkStringArg("string", $headline);
116  $clone = clone $this;
117  $clone->headline = $headline;
118  return $clone;
119  }
120 
124  public function getHeadline(): ?string
125  {
126  return $this->headline;
127  }
128 
132  public function withSubheadline($subheadline): T\PresentationRow
133  {
134  $this->checkStringArg("string", $subheadline);
135  $clone = clone $this;
136  $clone->subheadline = $subheadline;
137  return $clone;
138  }
139 
143  public function getSubheadline(): ?string
144  {
145  return $this->subheadline;
146  }
147 
151  public function withImportantFields(array $fields): T\PresentationRow
152  {
153  $clone = clone $this;
154  $clone->important_fields = $fields;
155  return $clone;
156  }
157 
161  public function getImportantFields(): array
162  {
164  }
165 
166 
170  public function withContent(Descriptive $content): T\PresentationRow
171  {
172  $clone = clone $this;
173  $clone->content = $content;
174  return $clone;
175  }
176 
180  public function getContent(): Descriptive
181  {
182  return $this->content;
183  }
184 
185 
189  public function withFurtherFieldsHeadline($headline): T\PresentationRow
190  {
191  $this->checkStringArg("string", $headline);
192  $clone = clone $this;
193  $clone->further_fields_headline = $headline;
194  return $clone;
195  }
196 
200  public function getFurtherFieldsHeadline(): ?string
201  {
203  }
204 
208  public function withFurtherFields(array $fields): T\PresentationRow
209  {
210  $clone = clone $this;
211  $clone->further_fields = $fields;
212  return $clone;
213  }
214 
218  public function getFurtherFields(): array
219  {
220  return $this->further_fields;
221  }
222 
223 
228  {
229  $check =
230  is_null($action)
231  || $action instanceof Button
232  || $action instanceof Dropdown;
233 
234  $expected =
235  " NULL or " .
236  " \ILIAS\UI\Component\Button\Button or " .
237  " \ILIAS\UI\Component\ropdown\Dropdown";
238 
239  $this->checkArg("action", $check, $this->wrongTypeMessage($expected, $action));
240  $clone = clone $this;
241  $clone->action = $action;
242  return $clone;
243  }
244 
248  public function getAction()
249  {
250  return $this->action;
251  }
252 
253  public function getTableId(): string
254  {
255  return $this->table_id;
256  }
257 }
initSignals()
Set the signals for this component.
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.static
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
__construct(SignalGeneratorInterface $signal_generator, string $table_id)
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCloseSignal()
Get the signal to collapse the row.
This describes a Row used in Presentation Table.
getShowSignal()
Get the signal to expand the row.
withContent(Descriptive $content)
Get a row like this with a descriptive listing as content.
$check
Definition: buildRTE.php:81
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.
withAction($action)
Get a row like this with a button or a dropdown for actions in the expanded row.