ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
InitUIFramework.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
30 {
31  public function init(\ILIAS\DI\Container $c): void
32  {
33  $c["ui.factory"] = function ($c) {
35  $c["ui.factory.counter"],
36  $c["ui.factory.button"],
37  $c["ui.factory.listing"],
38  $c["ui.factory.image"],
39  new \ILIAS\UI\Implementation\Component\Player\Factory(),
40  $c["ui.factory.panel"],
41  $c["ui.factory.modal"],
42  $c["ui.factory.progress"],
43  $c["ui.factory.dropzone"],
44  $c["ui.factory.popover"],
45  $c["ui.factory.divider"],
46  $c["ui.factory.link"],
47  $c["ui.factory.dropdown"],
48  $c["ui.factory.item"],
49  $c["ui.factory.viewcontrol"],
50  $c["ui.factory.chart"],
51  $c["ui.factory.input"],
52  $c["ui.factory.table"],
53  $c["ui.factory.messagebox"],
54  $c["ui.factory.card"],
55  $c["ui.factory.layout"],
56  $c["ui.factory.maincontrols"],
57  $c["ui.factory.tree"],
58  $c["ui.factory.menu"],
59  $c["ui.factory.symbol"],
60  $c["ui.factory.toast"],
61  $c["ui.factory.legacy"],
62  $c["ui.factory.launcher"],
63  $c["ui.factory.entity"],
64  $c["ui.factory.prompt"],
65  );
66  };
67  $c["ui.upload_limit_resolver"] = function ($c) {
68  return new \ILIAS\UI\Implementation\Component\Input\UploadLimitResolver(
69  new class () implements ILIAS\UI\Component\Input\Field\PhpUploadLimit {
70  public function getPhpUploadLimitInBytes(): int
71  {
72  return 0;
73  }
74  },
75  new class () implements ILIAS\UI\Component\Input\Field\GlobalUploadLimit {
76  public function getGlobalUploadLimitInBytes(): ?int
77  {
78  return null;
79  }
80  },
81  );
82  };
83  $c["ui.data_factory"] = function ($c) {
84  return new ILIAS\Data\Factory();
85  };
86  $c["ui.signal_generator"] = function ($c) {
88  };
89  $c["ui.factory.counter"] = function ($c) {
91  };
92  $c["ui.factory.button"] = function ($c) {
94  };
95  $c["ui.factory.listing"] = function ($c) {
97  new ILIAS\UI\Implementation\Component\Listing\Workflow\Factory(),
98  new ILIAS\UI\Implementation\Component\Listing\CharacteristicValue\Factory(),
99  new ILIAS\UI\Implementation\Component\Listing\Entity\Factory(),
100  );
101  };
102  $c["ui.factory.image"] = function ($c) {
104  };
105  $c["ui.factory.panel"] = function ($c) {
107  $c["ui.factory.panel.listing"],
108  new ILIAS\UI\Implementation\Component\Panel\Secondary\Factory(),
109  );
110  };
111  $c["ui.factory.interruptive_item"] = function ($c) {
113  };
114  $c["ui.factory.modal"] = function ($c) {
116  $c["ui.signal_generator"],
117  $c["ui.factory.interruptive_item"],
118  $c["ui.factory.input.field"],
119  );
120  };
121  $c["ui.factory.progress.refresh_interval"] = static fn(\ILIAS\DI\Container $c) =>
122  new class () implements \ILIAS\UI\Component\Progress\AsyncRefreshInterval {
123  public function getRefreshIntervalInMs(): int
124  {
125  return 1_000;
126  }
127  };
128  $c["ui.factory.progress"] = static fn(\ILIAS\DI\Container $c) =>
129  new \ILIAS\UI\Implementation\Component\Progress\Factory(
130  $c["ui.factory.progress.refresh_interval"],
131  $c["ui.signal_generator"],
132  $c["ui.factory.progress.state"],
133  );
134  $c["ui.factory.progress.state"] = static fn(\ILIAS\DI\Container $c) =>
135  new \ILIAS\UI\Implementation\Component\Progress\State\Factory(
136  new \ILIAS\UI\Implementation\Component\Progress\State\Bar\Factory(),
137  );
138  $c["ui.factory.dropzone"] = function ($c) {
139  return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
140  };
141  $c["ui.factory.popover"] = function ($c) {
142  return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
143  };
144  $c["ui.factory.divider"] = function ($c) {
146  };
147  $c["ui.factory.link"] = function ($c) {
149  };
150  $c["ui.factory.dropdown"] = function ($c) {
152  };
153  $c["ui.factory.item"] = function ($c) {
155  };
156  $c["ui.factory.toast"] = function ($c) {
157  return new ILIAS\UI\Implementation\Component\Toast\Factory($c["ui.signal_generator"]);
158  };
159  $c["ui.factory.viewcontrol"] = function ($c) {
161  $c["ui.signal_generator"]
162  );
163  };
164  $c["ui.factory.chart"] = function ($c) {
166  $c["ui.factory.progressmeter"],
167  $c["ui.factory.bar"]
168  );
169  };
170  $c["ui.factory.input"] = function ($c) {
172  $c["ui.signal_generator"],
173  $c["ui.factory.input.field"],
174  $c["ui.factory.input.container"],
175  $c["ui.factory.input.viewcontrol"]
176  );
177  };
178  $c["ui.factory.table"] = function ($c) {
182  $c["ui.signal_generator"],
183  $c['ui.factory.input.viewcontrol'],
184  $c['ui.factory.input.container.viewcontrol'],
185  $c["ui.data_factory"],
186  $c["ui.factory.table.column"],
187  $c["ui.factory.table.action"],
188  $c["ui.storage"],
189  $data_row_builder,
190  $ordering_row_builder
191  );
192  };
193  $c["ui.factory.table.column"] = function ($c) {
195  $c["lng"]
196  );
197  };
198  $c["ui.factory.table.action"] = function ($c) {
200  };
201  $c["ui.factory.messagebox"] = function ($c) {
203  };
204  $c["ui.factory.card"] = function ($c) {
206  };
207  $c["ui.factory.layout"] = function ($c) {
209  new ILIAS\UI\Implementation\Component\Layout\Page\Factory(),
210  new ILIAS\UI\Implementation\Component\Layout\Alignment\Factory(),
211  );
212  };
213  $c["ui.factory.maincontrols.slate"] = function ($c) {
215  $c['ui.signal_generator'],
216  $c['ui.factory.counter'],
217  $c["ui.factory.symbol"]
218  );
219  };
220  $c["ui.factory.maincontrols"] = function ($c) {
222  $c['ui.signal_generator'],
223  $c['ui.factory.maincontrols.slate']
224  );
225  };
226  $c["ui.factory.menu"] = function ($c) {
228  $c['ui.signal_generator']
229  );
230  };
231  $c["ui.factory.symbol.glyph"] = function ($c) {
233  };
234  $c["ui.factory.symbol.icon"] = function ($c) {
236  };
237  $c["ui.factory.symbol.avatar"] = function ($c) {
239  };
240  $c["ui.factory.symbol"] = function ($c) {
242  $c["ui.factory.symbol.icon"],
243  $c["ui.factory.symbol.glyph"],
244  $c["ui.factory.symbol.avatar"]
245  );
246  };
247  $c["ui.factory.progressmeter"] = function ($c) {
249  };
250  $c["ui.factory.bar"] = function ($c) {
252  };
253  $c["ui.factory.input.field"] = function ($c) {
255  $c["ui.factory.input.field.node"],
256  $c["ui.upload_limit_resolver"],
257  $c["ui.signal_generator"],
258  $c["ui.data_factory"],
259  $c["refinery"],
260  $c["lng"]
261  );
262  };
263  $c["ui.factory.input.field.node"] = function ($c) {
265  };
266  $c["ui.factory.input.container"] = function ($c) {
268  $c["ui.factory.input.container.form"],
269  $c["ui.factory.input.container.filter"],
270  $c["ui.factory.input.container.viewcontrol"]
271  );
272  };
273  $c["ui.factory.input.container.form"] = function ($c) {
275  $c["ui.factory.input.field"],
276  $c["ui.signal_generator"]
277  );
278  };
279  $c["ui.factory.input.container.filter"] = function ($c) {
281  $c["ui.signal_generator"],
282  $c["ui.factory.input.field"]
283  );
284  };
285  $c["ui.factory.input.container.viewcontrol"] = function ($c) {
287  $c["ui.signal_generator"],
288  $c["ui.factory.input.viewcontrol"],
289  );
290  };
291  $c["ui.factory.input.viewcontrol"] = function ($c) {
293  $c["ui.factory.input.field"],
294  $c["ui.data_factory"],
295  $c["refinery"],
296  $c["ui.signal_generator"],
297  $c["lng"],
298  );
299  };
300  $c["ui.factory.dropzone.file"] = function ($c) {
302  $c["ui.signal_generator"],
303  $c["ui.factory.input.field"],
304  );
305  };
306  $c["ui.factory.panel.listing"] = function ($c) {
308  };
309  $c["ui.renderer"] = function ($c) {
311  $c["ui.component_renderer_loader"],
312  $c["ui.javascript_binding"],
313  $c["lng"],
314  );
315  };
316  $c["ui.component_renderer_loader"] = function ($c) {
318  new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
319  $c["ui.resource_registry"],
320  new ILIAS\UI\Implementation\Render\FSLoader(
321  new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
322  $c["ui.factory"],
323  $c["ui.template_factory"],
324  $c["lng"],
325  $c["ui.javascript_binding"],
326  $c["ui.pathresolver"],
327  $c["ui.data_factory"],
328  $c["help.text_retriever"],
329  $c["ui.upload_limit_resolver"]
330  ),
331  new ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphRendererFactory(
332  $c["ui.factory"],
333  $c["ui.template_factory"],
334  $c["lng"],
335  $c["ui.javascript_binding"],
336  $c["ui.pathresolver"],
337  $c["ui.data_factory"],
338  $c["help.text_retriever"],
339  $c["ui.upload_limit_resolver"]
340  ),
341  new ILIAS\UI\Implementation\Component\Input\Field\FieldRendererFactory(
342  $c["ui.factory"],
343  $c["ui.template_factory"],
344  $c["lng"],
345  $c["ui.javascript_binding"],
346  $c["ui.pathresolver"],
347  $c["ui.data_factory"],
348  $c["help.text_retriever"],
349  $c["ui.upload_limit_resolver"]
350  ),
351  new ILIAS\UI\Implementation\Component\MessageBox\MessageBoxRendererFactory(
352  $c["ui.factory"],
353  $c["ui.template_factory"],
354  $c["lng"],
355  $c["ui.javascript_binding"],
356  $c["ui.pathresolver"],
357  $c["ui.data_factory"],
358  $c["help.text_retriever"],
359  $c["ui.upload_limit_resolver"]
360  ),
361  new ILIAS\UI\Implementation\Component\Input\Container\Form\FormRendererFactory(
362  $c["ui.factory"],
363  $c["ui.template_factory"],
364  $c["lng"],
365  $c["ui.javascript_binding"],
366  $c["ui.pathresolver"],
367  $c["ui.data_factory"],
368  $c["help.text_retriever"],
369  $c["ui.upload_limit_resolver"]
370  ),
371  new ILIAS\UI\Implementation\Component\Menu\MenuRendererFactory(
372  $c["ui.factory"],
373  $c["ui.template_factory"],
374  $c["lng"],
375  $c["ui.javascript_binding"],
376  $c["ui.pathresolver"],
377  $c["ui.data_factory"],
378  $c["help.text_retriever"],
379  $c["ui.upload_limit_resolver"]
380  ),
381  )
382  )
383  );
384  };
385  $c["ui.template_factory"] = function ($c) {
387  };
388  $c["ui.resource_registry"] = function ($c) {
390  };
391  $c["ui.javascript_binding"] = function ($c) {
393  };
394 
395  $c["ui.factory.tree"] = function ($c) {
397  new ILIAS\UI\Implementation\Component\Tree\Node\Factory(),
398  );
399  };
400 
401  $c["ui.factory.legacy"] = function ($c) {
402  return new ILIAS\UI\Implementation\Component\Legacy\Factory($c["ui.signal_generator"]);
403  };
404 
405  $c["ui.pathresolver"] = function ($c): ILIAS\UI\Implementation\Render\ImagePathResolver {
406  return new ilImagePathResolver();
407  };
408 
409  $c["ui.factory.launcher"] = function ($c): ILIAS\UI\Implementation\Component\Launcher\Factory {
411  $c["ui.factory.modal"]
412  );
413  };
414 
415  $c["ui.factory.entity"] = function ($c) {
417  };
418 
419  $c["ui.factory.prompt"] = function ($c) {
420  return new ILIAS\UI\Implementation\Component\Prompt\Factory($c["ui.signal_generator"]);
421  };
422 
423  // currently this is will be a session storage because we cannot store
424  // data on the client, see https://mantis.ilias.de/view.php?id=38503.
425  $c["ui.storage"] = function ($c): ArrayAccess {
426  return new class () implements ArrayAccess {
427  public function offsetExists(mixed $offset): bool
428  {
429  return ilSession::has($offset);
430  }
431  public function offsetGet(mixed $offset): mixed
432  {
433  return ilSession::get($offset);
434  }
435  public function offsetSet(mixed $offset, mixed $value): void
436  {
437  if (!is_string($offset)) {
438  throw new InvalidArgumentException('Offset needs to be of type string.');
439  }
440  ilSession::set($offset, $value);
441  }
442  public function offsetUnset(mixed $offset): void
443  {
444  ilSession::clear($offset);
445  }
446  };
447  };
448  }
449 }
static get(string $a_var)
Interface Observer Contains several chained tasks and infos about them.
$c
Definition: deliver.php:25
This is more or less a copy of the removed InitUIFramework file inside the Init component.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class HTTPServicesTest.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static has($a_var)
init(\ILIAS\DI\Container $c)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.