ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ViewFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
30final class ViewFactory
31{
33 private \ilLanguage $language;
34 private Services $http;
35
36 public function __construct(
37 private TableDataProvider $data_provider,
38 private ActionBuilder $action_builder,
39 private ViewControlBuilder $view_control_builder,
40 private UploadBuilder $upload_builder
41 ) {
42 global $DIC;
43 $this->http = $DIC->http();
44 $this->ui_factory = $DIC->ui()->factory();
45 $this->language = $DIC->language();
46 }
47
48 public function getComponentProvider(
49 Request $request
51 switch ($request->getMode()) {
53 return new RequestToDataTable(
54 $request,
55 $this->ui_factory,
56 $this->language,
57 $this->http,
58 $this->data_provider,
59 $this->action_builder,
60 $this->view_control_builder,
61 $this->upload_builder
62 );
63 case Mode::DECK:
64 case Mode::ITEMS:
65 case Mode::PRESENTATION_TABLE:
66 default:
67 throw new \InvalidArgumentException('Unknown mode or not implemented yet.');
68 }
69 }
70}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Class Services.
Definition: Services.php:38
__construct(private TableDataProvider $data_provider, private ActionBuilder $action_builder, private ViewControlBuilder $view_control_builder, private UploadBuilder $upload_builder)
Definition: ViewFactory.php:36
This is how the factory for UI elements looks.
Definition: Factory.php:38
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26