ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
RequestToPresentationTable.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
30 
35 {
36  use RIDHelper;
37 
38  private \ILIAS\ResourceStorage\Services $irss;
39 
40  public function __construct(
41  private Request $request,
42  private Factory $ui_factory,
43  private \ilLanguage $language,
44  private Services $http,
45  private TableDataProvider $data_provider,
46  private ActionBuilder $action_builder,
47  private ViewControlBuilder $view_control_builder,
48  private UploadBuilder $upload_builder
49  ) {
50  global $DIC;
51  $this->irss = $DIC->resourceStorage();
52  }
53 
54  private function buildTable(): Presentation
55  {
56  return $this->ui_factory->table()->presentation(
57  '',
58  [
59  $this->view_control_builder->getPagination(),
60  $this->view_control_builder->getSortation()
61  ],
62  function (PresentationRow $p, ResourceIdentification $rid) {
63  $revision_to_component = new RevisionToComponent($this->getCurrentRevision($rid));
64  $mapping = $revision_to_component->getAsRowMapping();
65  return $mapping($p, $rid);
66  }
67  )->withData($this->data_provider->getIdentifications());
68  }
69 
70  public function getComponents(): \Generator
71  {
72  yield from $this->upload_builder->getDropZone();
73  yield $this->buildTable();
74  // Modals must be rendered after the presentation table, otherwise there are no modals
75  yield from $this->action_builder->getModals();
76  }
77 }
__construct(private Request $request, private Factory $ui_factory, private \ilLanguage $language, private Services $http, private TableDataProvider $data_provider, private ActionBuilder $action_builder, private ViewControlBuilder $view_control_builder, private UploadBuilder $upload_builder)
$http
Definition: deliver.php:30
This is how the factory for UI elements looks.
Definition: Factory.php:37
global $DIC
Definition: shib_login.php:22
This describes a Row used in Presentation Table.
This describes a Presentation Table.