ILIAS  release_8 Revision v8.24
class.ilLMPresentationService.php
Go to the documentation of this file.
1<?php
2
20
26{
30 protected ilLMTree $lm_tree;
32 protected ilSetting $lm_set;
33 protected int $ref_id;
34 protected ilObjUser $user;
38
39 public function __construct(
41 ?array $query_params,
42 bool $offline = false,
43 bool $export_all_languages = false,
44 string $export_format = "",
45 ilCtrl $ctrl = null,
46 bool $embed_mode = false
47 ) {
48 global $DIC;
49
50 $ctrl = (is_null($ctrl))
51 ? $DIC->ctrl()
52 : $ctrl;
53
54 $post = is_null($query_params)
55 ? null
56 : [];
57
58 $this->request = $DIC->learningModule()
59 ->internal()
60 ->gui()
61 ->presentation()
62 ->request(
63 $query_params,
64 $post
65 );
66
67 $this->user = $user;
68 $this->ref_id = $this->request->getRefId();
69 $this->lm_set = new ilSetting("lm");
70 $this->lm_gui = new ilObjLearningModuleGUI([], $this->ref_id, true, false);
72 $lm = $this->lm_gui->getObject();
73 $this->lm = $lm;
74 $this->lm_tree = ilLMTree::getInstance($this->lm->getId());
75 $this->presentation_status = new ilLMPresentationStatus(
76 $user,
77 $this->lm,
78 $this->lm_tree,
79 $this->request->getTranslation(),
80 $this->request->getFocusId(),
81 $this->request->getFocusReturn(),
82 $this->request->getSearchString(),
83 $offline,
84 $export_all_languages,
85 $export_format,
86 $embed_mode
87 );
88
89 $this->navigation_status = new ilLMNavigationStatus(
90 $user,
91 $this->request->getObjId(),
92 $this->lm_tree,
93 $this->lm,
94 $this->lm_set,
95 $this->request->getBackPage(),
96 $this->request->getCmd(),
97 $this->request->getFocusId()
98 );
99
100 $this->tracker = ilLMTracker::getInstance($this->lm->getRefId());
101 $this->tracker->setCurrentPage($this->navigation_status->getCurrentPage());
102
103 $this->linker = new ilLMPresentationLinker(
104 $this->lm,
105 $this->lm_tree,
106 $this->navigation_status->getCurrentPage(),
107 $this->request->getRefId(),
108 $this->presentation_status->getLang(),
109 $this->request->getBackPage(),
110 $this->request->getFromPage(),
111 $this->presentation_status->offline(),
112 $this->presentation_status->getExportFormat(),
113 $this->presentation_status->exportAllLanguages(),
114 $ctrl,
115 $embed_mode,
116 $this->request->getFrame(),
117 $this->request->getObjId()
118 );
119 }
120
124 public function getSettings(): ilSetting
125 {
126 return $this->lm_set;
127 }
128
130 {
131 return $this->lm_gui;
132 }
133
135 {
136 return $this->lm;
137 }
138
139 public function getLMTree(): ilLMTree
140 {
141 return $this->lm_tree;
142 }
143
145 {
147 }
148
150 {
152 }
153
154 public function getTracker(): ilLMTracker
155 {
156 return $this->tracker;
157 }
158
160 {
161 return $this->request;
162 }
163
165 {
166 return $this->linker;
167 }
168}
Class ilCtrl provides processing control methods.
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...
Main service init and factory.
getSettings()
Get learning module settings.
ilLMPresentationStatus $presentation_status
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...
static getInstance(int $a_ref_id, int $a_user_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_tree_id)
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...
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
$post
Definition: ltitoken.php:49
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc