ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
RequestToItems.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 
33 {
34  use RIDHelper;
35 
36  private \ILIAS\ResourceStorage\Services $irss;
37 
38  public function __construct(
39  private Request $request,
40  private Factory $ui_factory,
41  private \ilLanguage $language,
42  private Services $http,
43  private TableDataProvider $data_provider,
44  private ActionBuilder $action_builder,
45  private ViewControlBuilder $view_control_builder,
46  private UploadBuilder $upload_builder
47  ) {
48  global $DIC;
49  $this->irss = $DIC->resourceStorage();
50  }
51 
52  protected function buildItemGroup(): Group
53  {
54  $items = [];
55  foreach ($this->data_provider->getIdentifications() as $resource_identification) {
56  $revision_to_card = new RevisionToComponent($this->getCurrentRevision($resource_identification));
57  $items[] = $revision_to_card->getAsItem(true)
58  ->withActions(
59  $this->action_builder->buildDropDownForResource($resource_identification)
60  );
61  }
62 
63  return $this->ui_factory->item()->group('', $items);
64  }
65 
66  public function getComponents(): \Generator
67  {
68  yield from $this->upload_builder->getDropZone();
69 
70  yield $this->ui_factory->panel()->standard(
71  $this->request->getTitle(),
72  $this->buildItemGroup()
73  )->withViewControls([
74  $this->view_control_builder->getPagination(),
75  $this->view_control_builder->getSortation()
76  ]);
77  // Modals must be rendered after the panel, otherwise there are no modals
78  yield from $this->action_builder->getModals();
79  }
80 }
__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