ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLSLocalDI.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 use \ILIAS\Data\Factory as DataFactory;
5 
9 class ilLSLocalDI extends Container
10 {
11  public function init(
13  ilLSDI $lsdic,
14  DataFactory $data_factory,
15  ilObjLearningSequence $object
16  ) {
17  $ref_id = (int) $object->getRefId();
18  $obj_id = (int) $object->getId();
19  $obj_title = $object->getTitle();
20 
21  $current_user = $dic['ilUser'];
22  $current_user_id = (int) $current_user->getId();
23 
24  $data_factory = new \ILIAS\Data\Factory();
25 
26  $this["obj.ref_id"] = $ref_id;
27  $this["obj.obj_id"] = $obj_id;
28  $this["obj.title"] = (string) $obj_title;
29 
30  $this["usr.id"] = $current_user_id;
31 
32  $this["obj.sorting"] = function ($c) : ilContainerSorting {
33  return ilContainerSorting::_getInstance($c["obj.obj_id"]);
34  };
35 
36  $this["db.lsitems"] = function ($c) use ($dic, $lsdic) : ilLSItemsDB {
37  $online_status = new LSItemOnlineStatus();
38  return new ilLSItemsDB(
39  $dic["tree"],
40  $c["obj.sorting"],
41  $lsdic["db.postconditions"],
42  $online_status
43  );
44  };
45 
46  $this["db.progress"] = function ($c) use ($dic) : ilLearnerProgressDB {
47  return new ilLearnerProgressDB(
48  $c["db.lsitems"],
49  $dic["ilAccess"],
50  $dic['ilObjDataCache']
51  );
52  };
53 
54  $this["learneritems"] = function ($c) use ($dic, $lsdic) : ilLSLearnerItemsQueries {
55  return new ilLSLearnerItemsQueries(
56  $c["db.progress"],
57  $lsdic["db.states"],
58  $c["obj.ref_id"],
59  $c["usr.id"]
60  );
61  };
62 
63  $this["gui.learner"] = function ($c) use ($dic, $lsdic, $object) : ilObjLearningSequenceLearnerGUI {
64  $has_items = count($c["learneritems"]->getItems()) > 0;
65  $first_access = $c["learneritems"]->getFirstAccess();
66 
68  $c["obj.ref_id"],
69  $has_items,
70  $first_access,
71  $c["usr.id"],
72  $dic["ilAccess"],
73  $dic["ilCtrl"],
74  $dic["lng"],
75  $dic["tpl"],
76  $dic["ilToolbar"],
77  $dic["ui.factory"],
78  $dic["ui.renderer"],
79  $c["roles"],
80  $lsdic["db.settings"]->getSettingsFor($c["obj.obj_id"]),
81  $c["player.curriculumbuilder"],
82  $c["player"]
83  );
84  };
85 
86  $this["gui.toc"] = function ($c) use ($dic) : ilLSTOCGUI {
87  return new ilLSTOCGUI(
88  $c["player.urlbuilder"],
89  $dic["ilCtrl"]
90  );
91  };
92 
93  $this["gui.loc"] = function ($c) use ($dic) : ilLSLocatorGUI {
94  return new ilLSLocatorGUI(
95  $c["player.urlbuilder"],
96  $dic["ui.factory"]
97  );
98  };
99 
100  $this["player.viewfactory"] = function ($c) use ($dic) : ilLSViewFactory {
101  return new ilLSViewFactory(
102  $dic['service.kiosk_mode'],
103  $dic["lng"],
104  $dic["ilAccess"]
105  );
106  };
107 
108  $this["player.urlbuilder"] = function ($c) use ($dic, $data_factory) : LSUrlBuilder {
109  $player_base_url = $dic['ilCtrl']->getLinkTargetByClass(
110  'ilObjLearningSequenceLearnerGUI',
112  '',
113  false,
114  false
115  );
116  $player_base_url = $data_factory->uri(ILIAS_HTTP_PATH . '/' . $player_base_url);
117 
118  return new LSUrlBuilder($player_base_url);
119  };
120 
121  $this["globalsetttings"] = function ($c) use ($dic) {
122  $db = new ilLSGlobalSettingsDB($dic['ilSetting']);
123  return $db->getSettings();
124  };
125 
126  $this["player.controlbuilder"] = function ($c) use ($dic) : LSControlBuilder {
127  return new LSControlBuilder(
128  $dic["ui.factory"],
129  $c["player.urlbuilder"],
130  $dic["lng"],
131  $c["globalsetttings"]
132  );
133  };
134 
135  $this["player.kioskrenderer"] = function ($c) use ($dic) : ilKioskPageRenderer {
136  $kiosk_template = new ilTemplate("tpl.kioskpage.html", true, true, 'Modules/LearningSequence');
137  $window_title = $dic['ilSetting']->get('short_inst_name');
138  if ($window_title === false) {
139  $window_title = 'ILIAS';
140  }
141 
142  return new ilKioskPageRenderer(
143  $dic["tpl"],
144  $dic["global_screen"]->layout()->meta(),
145  $dic["ui.factory"],
146  $dic["ui.renderer"],
147  $dic['lng'],
148  $kiosk_template,
149  $c["gui.toc"],
150  $c["gui.loc"],
151  $window_title
152  );
153  };
154 
155  $this["player.curriculumbuilder"] = function ($c) use ($dic) : ilLSCurriculumBuilder {
156  return new ilLSCurriculumBuilder(
157  $c["learneritems"],
158  $dic["ui.factory"],
159  $dic["lng"],
161  $c["player.urlbuilder"]
162  );
163  };
164 
165  $this["player"] = function ($c) use ($dic, $lsdic) : ilLSPlayer {
166  return new ilLSPlayer(
167  $c["obj.title"],
168  $c["learneritems"],
169  $c["player.controlbuilder"],
170  $c["player.urlbuilder"],
171  $c["player.curriculumbuilder"],
172  $c["player.viewfactory"],
173  $c["player.kioskrenderer"],
174  $dic["ui.factory"],
175  $lsdic["gs.current_context"]
176 
177  );
178  };
179 
180  $this["participants"] = function ($c) use ($dic) : ilLearningSequenceParticipants {
182  $c["obj.obj_id"],
183  $dic["ilLoggerFactory"]->getRootLogger(),
184  $dic["ilAppEventHandler"],
185  $dic["ilSetting"]
186  );
187  };
188 
189  $this["roles"] = function ($c) use ($dic, $current_user) : ilLearningSequenceRoles {
190  return new ilLearningSequenceRoles(
191  $c["obj.ref_id"],
192  $c["obj.obj_id"],
193  $c["participants"],
194  $dic["ilCtrl"],
195  $dic["rbacadmin"],
196  $dic["rbacreview"],
197  $dic["ilDB"],
198  $current_user
199  );
200  };
201  }
202 }
Class ilLSItemsDB.
Definition: ilLSItemsDB.php:11
Class ilObjLearningSequence.
Repository for LSGlobalSettings over ILIAS global settings.
Class ilObjLearningSequenceLearnerGUI.
Class LSUrlBuilder.
getId()
get object id public
Class ilKioskPageRenderer.
getTitle()
get object title public
This combines calls to ProgressDB and StateDB to handle learner-items in the context of a specific LS...
Implementation of KioskMode Player.
init(ArrayAccess $dic, ilLSDI $lsdic, DataFactory $data_factory, ilObjLearningSequence $object)
Get LearningProgress and availability of items in sequence.
Class LSControlBuilder.
GUI for Locator element.
Tree-GUI for ToC.
getRefId()
get reference id public
$dic
Definition: result.php:13
static _getInstance($a_obj_id)
get instance by obj_id
Builds the overview (curriculum) of a LearningSequence.