ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
RequestToItems.php
Go to the documentation of this file.
1<?php
2
19declare(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}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Class Services.
Definition: Services.php:38
__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)
language handling
$http
Definition: deliver.php:30
Common interface to item groups.
Definition: Group.php:30
This is how the factory for UI elements looks.
Definition: Factory.php:38
global $DIC
Definition: shib_login.php:26