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