ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
trait.GlobalDICGUIServices.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Repository;
22 
24 use ILIAS\HTTP;
39 
44 {
45  private \ILIAS\DI\Container $DIC;
46 
47  protected function initGUIServices(\ILIAS\DI\Container $DIC): void
48  {
49  $this->DIC = $DIC;
51  }
52 
53  public function ui(): UIServices
54  {
55  return $this->DIC->ui();
56  }
57 
58  public function object(): \ilObjectService
59  {
60  return $this->DIC->object();
61  }
62 
63  public function ctrl(): \ilCtrl
64  {
65  return $this->DIC->ctrl();
66  }
67 
68  public function http(): HTTP\Services
69  {
70  return $this->DIC->http();
71  }
72 
73  public function httpUtil(): HTTPUtil
74  {
75  return new HTTPUtil($this->DIC->http());
76  }
77 
78  public function html(): HTMLUtil
79  {
80  return new HTMLUtil();
81  }
82 
84  {
85  return $this->DIC->ui()->mainTemplate();
86  }
87 
88  public function initFetch(): void
89  {
90  $main_tpl = $this->mainTemplate();
91  $main_tpl->addJavaScript("assets/js/repository.js");
92  }
93 
94  public function upload(): FileUpload
95  {
96  return $this->DIC->upload();
97  }
98 
99  public function toolbar(): \ilToolbarGUI
100  {
101  return $this->DIC->toolbar();
102  }
103 
104  public function globalScreen(): GlobalScreen\Services
105  {
106  return $this->DIC->globalScreen();
107  }
108 
109  public function help(): \ilHelpGUI
110  {
111  return $this->DIC->help();
112  }
113 
114  public function tabs(): \ilTabsGUI
115  {
116  return $this->DIC->tabs();
117  }
118 
119  public function locator(): \ilLocatorGUI
120  {
121  return $this->DIC["ilLocator"];
122  }
123 
125  {
126  return $this->DIC["ilNavigationHistory"];
127  }
128 
132  public function form(
133  $class_path,
134  string $cmd,
135  string $submit_caption = ""
136  ): FormAdapterGUI {
137  return new FormAdapterGUI(
138  $class_path,
139  $cmd,
140  $submit_caption
141  );
142  }
143 
144  public function modal(
145  string $title = "",
146  string $cancel_label = ""
147  ): ModalAdapterGUI {
148  return new ModalAdapterGUI(
149  $title,
150  $cancel_label,
151  $this->httpUtil()
152  );
153  }
154 
158  public function send(string $output): void
159  {
160  $http = $this->http();
161  $http->saveResponse($http->response()->withBody(
162  Streams::ofString($output)
163  ));
164  $http->sendResponse();
165  $http->close();
166  }
167 
171  public function filter(
172  string $filter_id,
173  $class_path,
174  string $cmd,
175  bool $activated = true,
176  bool $expanded = true
177  ): FilterAdapterGUI {
178  return new FilterAdapterGUI(
179  $filter_id,
180  $class_path,
181  $cmd,
182  $activated,
183  $expanded
184  );
185  }
186 
187  public function button(
188  string $caption,
189  string $cmd
190  ): ButtonAdapterGUI {
191  return new ButtonAdapterGUI(
192  $caption,
193  $cmd
194  );
195  }
196 
197  public function link(
198  string $caption,
199  string $href,
200  bool $new_viewport = false
201  ): LinkAdapterGUI {
202  return new LinkAdapterGUI(
203  $caption,
204  $href,
205  $new_viewport
206  );
207  }
208 
209  public function symbol(
210  ): SymbolAdapterGUI {
211  return new SymbolAdapterGUI(
212  );
213  }
214 
215  public function listing(
216  ): ListingAdapterGUI {
217  return new ListingAdapterGUI(
218  );
219  }
220 
221  public function profile(): ProfileGUI
222  {
223  return new ProfileGUI(
224  $this->DIC->repository()->internal()->domain()->profile(),
225  $this->ui()->factory()
226  );
227  }
228 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
button(string $caption, string $cmd)
PhpIncompatibleReturnTypeInspection
initGUIServices(\ILIAS\DI\Container $DIC)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
Help GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$http
Definition: deliver.php:30
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
Class HTTPServicesTest.
global $DIC
Definition: shib_login.php:22
Class FileUpload.
Definition: FileUpload.php:37
Last visited history for repository items.
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
form( $class_path, string $cmd, string $submit_caption="")
modal(string $title="", string $cancel_label="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
link(string $caption, string $href, bool $new_viewport=false)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)