ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilStudyProgrammeDIC.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  public static ?Container $dic = null;
26 
27  public static function dic(): Container
28  {
29  if (!self::$dic) {
30  self::$dic = self::buildDIC();
31  }
32  return self::$dic;
33  }
34 
35  public static function specificDicFor(ilObjStudyProgramme $prg): Container
36  {
37  global $DIC;
38  $dic = new Container();
39 
40  $dic['permissionhelper'] = static function ($dic) use ($prg, $DIC) {
41  return new ilPRGPermissionsHelper(
42  $DIC['ilAccess'],
44  $DIC['ilObjDataCache'],
45  new ilOrgUnitPositionAccess($DIC['ilAccess']),
46  (int) $prg->getRefid()
47  );
48  };
49 
50  $dic['ilStudyProgrammeUserTable'] = function ($dic) use ($DIC) {
51  return new ilStudyProgrammeUserTable(
52  $DIC['ilDB'],
54  $dic['repo.assignment'],
55  $DIC['lng'],
56  $dic['permissionhelper']
57  );
58  };
59 
60  $dic['model.Settings.ilStudyProgrammeSettingsRepository'] = function ($dic) use ($DIC) {
62  $DIC['ilDB']
63  );
64  };
65  $dic['repo.assignment'] = function ($dic) use ($DIC) {
66  return new ilPRGAssignmentDBRepository(
67  $DIC['ilDB'],
68  $DIC['tree'],
69  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
70  $dic['ilStudyProgrammeDelayedEvents'],
72  );
73  };
74  $dic['filter.assignment'] = function ($dic) use ($DIC): ilPRGAssignmentFilter {
75  return new ilPRGAssignmentFilter(
76  $DIC['lng']
77  );
78  };
79 
80  $dic['Log'] = static fn($dic) =>
82 
83  $dic['mail'] = static fn($dic) =>
84  new ilPRGMail(
85  $dic['Log'],
86  $DIC['lng']
87  );
88  $dic['ilAppEventHandler'] = static fn($dic) =>
89  $DIC->offsetExists('ilAppEventHandler') ? $DIC['ilAppEventHandler'] : new \ilAppEventHandler();
90 
91  $dic['prgEventHandler'] = static fn($dic) => new PRGEventHandler($dic['mail']);
92 
93  $dic['ilStudyProgrammeEvents'] = static fn($dic) =>
95  $dic['Log'],
96  $dic['ilAppEventHandler'],
97  $dic['prgEventHandler']
98  );
99  $dic['ilStudyProgrammeDelayedEvents'] = static fn($dic) =>
100  new PRGEventsDelayed($dic['ilStudyProgrammeEvents']);
101 
102  $dic['ui.factory'] = static fn($dic) => $DIC['ui.factory'];
103  $dic['ui.renderer'] = static fn($dic) => $DIC['ui.renderer'];
104 
105  $dic['ilStudyProgrammeMailMemberSearchGUI'] = static fn($dic) =>
107  $DIC['ilCtrl'],
108  $DIC['tpl'],
109  $DIC['lng'],
110  $DIC['ilAccess'],
111  $DIC->http()->wrapper(),
112  $DIC->refinery(),
113  $dic['permissionhelper'],
114  $prg->getId(),
115  $dic['PRGMessages']
116  );
117 
118  $dic['PRGMessages'] = static fn($dic): ilPRGMessagePrinter =>
121  $DIC['lng'],
122  $DIC['tpl']
123  );
124 
125  $dic['DataFactory'] = static fn($dic) => new \ILIAS\Data\Factory();
126 
127  return $dic;
128  }
129 
130 
131  protected static function buildDIC(): Container
132  {
133  global $DIC;
134  $dic = new Container();
135 
136  $dic['mail'] = static fn($dic) =>
137  new ilPRGMail(
138  $dic['Log'],
139  $DIC['lng']
140  );
141 
142  $dic['ilAppEventHandler'] = static fn($dic) =>
143  $DIC->offsetExists('ilAppEventHandler') ? $DIC['ilAppEventHandler'] : new \ilAppEventHandler();
144 
145  $dic['prgEventHandler'] = static fn($dic) => new PRGEventHandler($dic['mail']);
146 
147  $dic['ilStudyProgrammeEvents'] = static fn($dic) =>
149  $dic['Log'],
150  $dic['ilAppEventHandler'],
151  $dic['prgEventHandler']
152  );
153  $dic['ilStudyProgrammeDelayedEvents'] = static fn($dic) =>
154  new PRGEventsDelayed($dic['ilStudyProgrammeEvents']);
155 
156  $dic['repo.assignment'] = static fn($dic) =>
158  $DIC['ilDB'],
159  $DIC['tree'],
160  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
161  $dic['ilStudyProgrammeDelayedEvents'],
163  );
164 
165 
166  $dic['model.Settings.ilStudyProgrammeSettingsRepository'] = static fn($dic) =>
168  $DIC['ilDB']
169  );
170  $dic['model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'] = static fn($dic) =>
172  $DIC['ilDB'],
173  (int) $DIC['ilUser']->getId()
174  );
175  $dic['model.AutoMemberships.ilStudyProgrammeMembershipSourceReaderFactory'] = static fn($dic) =>
177  $dic['model.Type.ilStudyProgrammeTypeRepository'] = static fn($dic) =>
179  $DIC['ilDB'],
180  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
181  $DIC['ilUser'],
182  $DIC['lng'],
183  $DIC['component.factory'],
184  $DIC['ui.factory'],
185  $DIC['ui.renderer'],
186  $DIC['resource_storage'],
187  );
188  $dic['model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'] = static fn($dic) =>
190  $DIC['ilDB'],
191  (int) $DIC['ilUser']->getId()
192  );
193  $dic['ilObjStudyProgrammeSettingsGUI'] = static fn($dic) =>
195  $DIC['tpl'],
196  $DIC['ilCtrl'],
197  $DIC['lng'],
198  $DIC->ui()->factory()->input(),
199  $DIC->ui()->renderer(),
200  $DIC->http()->request(),
201  $DIC->refinery(),
202  $dic['DataFactory'],
203  $dic['model.Type.ilStudyProgrammeTypeRepository'],
204  $dic['ilStudyProgrammeCommonSettingsGUI'],
205  $DIC['ilTabs'],
206  $DIC->http()->wrapper()->query(),
207  $DIC['learning_object_metadata']
208  );
209  $dic['PRGMessages'] = static fn($dic) =>
212  $DIC['lng'],
213  $DIC['tpl']
214  );
215  $dic['ilObjStudyProgrammeMembersGUI'] = static fn($dic) =>
217  $DIC['tpl'],
218  $DIC['ilCtrl'],
219  $DIC['ilToolbar'],
220  $DIC['lng'],
221  $DIC['ilUser'],
222  $DIC['ilTabs'],
223  $dic['repo.assignment'],
224  $dic['ilStudyProgrammeRepositorySearchGUI'],
225  $dic['ilObjStudyProgrammeIndividualPlanGUI'],
226  $dic['PRGMessages'],
227  $dic['DataFactory'],
228  new ilConfirmationGUI(),
229  $DIC->http()->wrapper(),
230  $DIC->refinery(),
231  $DIC['ui.factory'],
232  $DIC['ui.renderer'],
233  $DIC->http()->request(),
234  );
235  $dic['ilObjStudyProgrammeAutoMembershipsGUI'] = static fn($dic) =>
237  $DIC['tpl'],
238  $DIC['ilCtrl'],
239  $DIC['ilToolbar'],
240  $DIC['lng'],
241  $DIC->ui()->factory(),
242  $DIC['ui.factory']->messageBox(),
243  $DIC['ui.factory']->button(),
244  $DIC->ui()->renderer(),
245  $DIC->http()->request(),
246  $DIC['tree'],
247  $DIC->http()->wrapper()->query(),
248  $DIC->refinery(),
249  $DIC['rbacreview']
250  );
251  $dic['ilStudyProgrammeTypeGUI'] = static fn($dic): ilStudyProgrammeTypeGUI =>
253  $DIC['tpl'],
254  $DIC['ilCtrl'],
255  $DIC['ilAccess'],
256  $DIC['ilToolbar'],
257  $DIC['lng'],
258  $DIC['ilias'],
259  $DIC['ilTabs'],
260  $DIC['ilUser'],
261  $dic['model.Type.ilStudyProgrammeTypeRepository'],
262  $DIC->ui()->factory(),
263  $DIC->ui()->renderer(),
264  $dic['DataFactory'],
265  $DIC->http()->request(),
266  $DIC->refinery(),
267  $DIC->http()->wrapper()->query()
268  );
269 
270  $dic['ilStudyProgrammeRepositorySearchGUI'] = static fn($dic) =>
272  $dic['ilObjStudyProgrammeIndividualPlanGUI'] = static fn($dic) =>
274  $DIC['tpl'],
275  $DIC['ilCtrl'],
276  $DIC['lng'],
277  $DIC['ilUser'],
278  $dic['repo.assignment'],
279  $dic['PRGMessages'],
280  $DIC->http()->wrapper(),
281  $DIC->refinery()
282  );
283  $dic['ilObjStudyProgrammeAutoCategoriesGUI'] = static fn($dic) =>
285  $DIC['tpl'],
286  $DIC['ilCtrl'],
287  $DIC['ilToolbar'],
288  $DIC['lng'],
289  $DIC->ui()->factory(),
290  $DIC['ui.factory']->messageBox(),
291  $DIC['ui.factory']->button(),
292  $DIC->ui()->renderer(),
293  $DIC->http()->request(),
294  $DIC['tree'],
295  $DIC->http()->wrapper()->query(),
296  $DIC->refinery()
297  );
298  $dic['DataFactory'] = static fn($dic) =>
299  new \ILIAS\Data\Factory();
300  $dic['ilOrgUnitObjectTypePositionSetting'] = static fn($dic) =>
302 
303  $dic['ilStudyProgrammeChangeExpireDateGUI'] = static fn($dic) =>
305  $DIC['ilCtrl'],
306  $DIC['tpl'],
307  $DIC['lng'],
308  $DIC['ilAccess'],
309  $DIC['ilUser'],
310  $DIC->ui()->factory()->input(),
311  $DIC->ui()->renderer(),
312  $DIC->http()->request(),
313  $DIC->refinery(),
314  $dic['DataFactory'],
315  $dic['PRGMessages']
316  );
317  $dic['ilStudyProgrammeChangeDeadlineGUI'] = static fn($dic) =>
319  $DIC['ilCtrl'],
320  $DIC['tpl'],
321  $DIC['lng'],
322  $DIC['ilAccess'],
323  $DIC['ilUser'],
324  $DIC->ui()->factory()->input(),
325  $DIC->ui()->renderer(),
326  $DIC->http()->request(),
327  $DIC->refinery(),
328  $dic['DataFactory'],
329  $dic['PRGMessages']
330  );
331 
332  $dic['permissionhelper'] = static function ($dic) use ($DIC) {
333  return new ilPRGPermissionsHelper(
334  $DIC['ilAccess'],
336  $DIC['ilObjDataCache'],
337  new ilOrgUnitPositionAccess($DIC['ilAccess']),
338  -1
339  );
340  };
341 
342  $dic['ilStudyProgrammeUserTable'] = function ($dic) use ($DIC) {
343  return new ilStudyProgrammeUserTable(
344  $DIC['ilDB'],
346  $dic['repo.assignment'],
347  $DIC['lng'],
348  $dic['permissionhelper']
349  );
350  };
351 
352  $dic['ilStudyProgrammeCommonSettingsGUI'] = static fn($dic) =>
354  $DIC['ilCtrl'],
355  $DIC['tpl'],
356  $DIC['lng'],
357  $DIC->object()
358  );
359  $dic['Log'] = static fn($dic) =>
361 
362  $dic['current_user'] = static fn($dic) =>
363  $DIC['ilUser'];
364 
365  $dic['cron.riskyToFail'] = static fn($dic) =>
366  new ilPrgRiskyToFail(
367  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
368  $dic['ilStudyProgrammeEvents']
369  );
370  $dic['cron.notRestarted'] = static fn($dic) =>
371  new ilPrgNotRestarted(
372  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
373  $dic['ilStudyProgrammeEvents']
374  );
375  $dic['cron.restart'] = static fn($dic) =>
376  new ilPrgRestart(
377  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
378  $dic['ilStudyProgrammeEvents']
379  );
380  $dic['ui.factory'] = static fn($dic) => $DIC['ui.factory'];
381 
382  $dic['pc.statusinfo'] = static fn($dic) =>
384  $DIC['ui.factory'],
385  $DIC['ui.renderer'],
386  $DIC['lng'],
387  $DIC['ilCtrl'],
388  new ilTemplate("tpl.statusinformation.html", true, true, 'components/ILIAS/StudyProgramme'),
389  $dic['repo.assignment'],
390  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
392  $dic['current_user']->getId()
393  );
394 
395  $dic['pc.actionnote'] = static fn($dic) =>
397  $DIC['ui.factory'],
398  $DIC['ui.renderer'],
399  $DIC['lng'],
400  $DIC['ilCtrl'],
401  new ilTemplate("tpl.action_note.html", true, true, 'components/ILIAS/StudyProgramme'),
402  $dic['repo.assignment'],
403  $dic['model.Settings.ilStudyProgrammeSettingsRepository'],
404  $dic['current_user']->getId()
405  );
406 
407  return $dic;
408  }
409 }
static getLogger(string $a_component_id)
Get component logger.
Util around ilPRGMessageCollection factors and output collections.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Builds PageContent "Status Information".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Provides adapters to read member-ids from a specific source.
Validates if an active certificate is stored in the database and can be downloaded by the user...
global $DIC
Definition: shib_login.php:22
static specificDicFor(ilObjStudyProgramme $prg)
ilObjStudyProgrammeMembersGUI: ilStudyProgrammeRepositorySearchGUI ilObjStudyProgrammeMembersGUI: il...
Send mails to users (usually triggered by cron)
Both role and OrgU-based permissions are relevant in many places of the PRG.
ilStudyProgrammeUserTable provides a flattened list of progresses at a programme-node.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
Custom repository search gui class for study programme to make it possible to get a handle on users s...
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
$dic
Definition: result.php:31
Builds PageContent "Note".
ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Holds information about multi-actions, mainly in context of member-assignemnts and status changes...