ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
trait.GlobalDICGUIServices.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
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 upload(): FileUpload
89  {
90  return $this->DIC->upload();
91  }
92 
93  public function toolbar(): \ilToolbarGUI
94  {
95  return $this->DIC->toolbar();
96  }
97 
98  public function globalScreen(): GlobalScreen\Services
99  {
100  return $this->DIC->globalScreen();
101  }
102 
103  public function help(): \ilHelpGUI
104  {
105  return $this->DIC->help();
106  }
107 
108  public function tabs(): \ilTabsGUI
109  {
110  return $this->DIC->tabs();
111  }
112 
113  public function locator(): \ilLocatorGUI
114  {
115  return $this->DIC["ilLocator"];
116  }
117 
119  {
120  return $this->DIC["ilNavigationHistory"];
121  }
122 
126  public function form(
127  $class_path,
128  string $cmd,
129  string $submit_caption = ""
130  ): FormAdapterGUI {
131  return new FormAdapterGUI(
132  $class_path,
133  $cmd,
134  $submit_caption
135  );
136  }
137 
138  public function modal(
139  string $title = "",
140  string $cancel_label = ""
141  ): ModalAdapterGUI {
142  return new ModalAdapterGUI(
143  $title,
144  $cancel_label,
145  $this->httpUtil()
146  );
147  }
148 
152  public function send(string $output): void
153  {
154  $http = $this->http();
155  $http->saveResponse($http->response()->withBody(
156  Streams::ofString($output)
157  ));
158  $http->sendResponse();
159  $http->close();
160  }
161 
165  public function filter(
166  string $filter_id,
167  $class_path,
168  string $cmd,
169  bool $activated = true,
170  bool $expanded = true
171  ): FilterAdapterGUI {
172  return new FilterAdapterGUI(
173  $filter_id,
174  $class_path,
175  $cmd,
176  $activated,
177  $expanded
178  );
179  }
180 
181  public function button(
182  string $caption,
183  string $cmd
184  ): ButtonAdapterGUI {
185  return new ButtonAdapterGUI(
186  $caption,
187  $cmd
188  );
189  }
190 
191  public function link(
192  string $caption,
193  string $href,
194  bool $new_viewport = false
195  ): LinkAdapterGUI {
196  return new LinkAdapterGUI(
197  $caption,
198  $href,
199  $new_viewport
200  );
201  }
202 
203  public function symbol(
204  ): SymbolAdapterGUI {
205  return new SymbolAdapterGUI(
206  );
207  }
208 
209  public function listing(
210  ): ListingAdapterGUI {
211  return new ListingAdapterGUI(
212  );
213  }
214 
215  public function profile(): ProfileGUI
216  {
217  return new ProfileGUI(
218  $this->DIC->repository()->internal()->domain()->profile(),
219  $this->ui()->factory()
220  );
221  }
222 }
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...
Class ChatMainBarProvider .
Help GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
global $DIC
Definition: feed.php:28
Provides fluid interface to RBAC services.
Definition: UIServices.php:23
Class HTTPServicesTest.
$http
Definition: raiseError.php:7
Class FileUpload.
Definition: FileUpload.php:34
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)