ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
trait.GlobalDICGUIServices.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Repository;
22
24use ILIAS\HTTP;
38
43{
44 private \ILIAS\DI\Container $DIC;
45
46 protected function initGUIServices(\ILIAS\DI\Container $DIC): void
47 {
48 $this->DIC = $DIC;
50 }
51
52 public function ui(): UIServices
53 {
54 return $this->DIC->ui();
55 }
56
57 public function object(): \ilObjectService
58 {
59 return $this->DIC->object();
60 }
61
62 public function ctrl(): \ilCtrl
63 {
64 return $this->DIC->ctrl();
65 }
66
67 public function http(): HTTP\Services
68 {
69 return $this->DIC->http();
70 }
71
72 public function httpUtil(): HTTPUtil
73 {
74 return new HTTPUtil($this->DIC->http());
75 }
76
77 public function html(): HTMLUtil
78 {
79 return new HTMLUtil();
80 }
81
83 {
84 return $this->DIC->ui()->mainTemplate();
85 }
86
87 public function initFetch(): void
88 {
89 $main_tpl = $this->mainTemplate();
90 $main_tpl->addJavaScript("assets/js/repository.js");
91 }
92
93 public function clearAsnyOnloadCode(): void
94 {
95 $this->ui()->renderer()->renderAsync(
96 $this->ui()->factory()->legacy()->content("")
97 );
98 }
99
100 public function upload(): FileUpload
101 {
102 return $this->DIC->upload();
103 }
104
105 public function toolbar(): \ilToolbarGUI
106 {
107 return $this->DIC->toolbar();
108 }
109
111 {
112 return $this->DIC->globalScreen();
113 }
114
115 public function help(): \ilHelpGUI
116 {
117 return $this->DIC->help();
118 }
119
120 public function tabs(): \ilTabsGUI
121 {
122 return $this->DIC->tabs();
123 }
124
125 public function locator(): \ilLocatorGUI
126 {
127 return $this->DIC["ilLocator"];
128 }
129
131 {
132 return $this->DIC["ilNavigationHistory"];
133 }
134
138 public function form(
139 ?array $class_path,
140 string $cmd,
141 string $submit_caption = ""
142 ): FormAdapterGUI {
144 $class_path,
145 $cmd,
146 $submit_caption
147 );
148 }
149
150 public function modal(
151 string $title = "",
152 string $cancel_label = ""
153 ): ModalAdapterGUI {
155 $title,
156 $cancel_label,
157 $this->httpUtil()
158 );
159 }
160
164 public function send(string $output): void
165 {
166 $http = $this->http();
167 $http->saveResponse($http->response()->withBody(
168 Streams::ofString($output)
169 ));
170 $http->sendResponse();
171 $http->close();
172 }
173
177 public function filter(
178 string $filter_id,
179 array $class_path,
180 string $cmd,
181 bool $activated = true,
182 bool $expanded = true
185 $filter_id,
186 $class_path,
187 $cmd,
188 $activated,
189 $expanded
190 );
191 }
192
193 public function button(
194 string $caption,
195 string $cmd
198 $caption,
199 $cmd
200 );
201 }
202
203 public function link(
204 string $caption,
205 string $href,
206 bool $new_viewport = false
207 ): LinkAdapterGUI {
209 $caption,
210 $href,
211 $new_viewport
212 );
213 }
214
215 public function symbol(
218 );
219 }
220
221 public function listing(
224 );
225 }
226
227 public function profile(): ProfileGUI
228 {
229 return new ProfileGUI(
230 $this->DIC->repository()->internal()->domain()->profile(),
231 $this->ui()->factory()
232 );
233 }
234}
factory()
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
Class ilCtrl provides processing control methods.
Help GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Last visited history for repository items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$http
Definition: deliver.php:30
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class HTTPServicesTest.
@noinspection PhpIncompatibleReturnTypeInspection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
modal(string $title="", string $cancel_label="")
button(string $caption, string $cmd)
form(?array $class_path, string $cmd, string $submit_caption="")
initGUIServices(\ILIAS\DI\Container $DIC)
link(string $caption, string $href, bool $new_viewport=false)
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26
catch(ilCmiXapiException $e) send($response)
Definition: xapitoken.php:97