ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLMPresentationService.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $lm;
17
21 protected $tracker;
22
26 public function __construct(
27 ilObjUser $user,
28 array $query_params,
29 bool $offline = false,
30 bool $export_all_languages = false,
31 string $export_format = "",
32 ilCtrl $ctrl = null,
33 bool $embed_mode = false
34 ) {
35 global $DIC;
36
37 $ctrl = (is_null($ctrl))
38 ? $DIC->ctrl()
39 : $ctrl;
40
41 $this->request = new ilLMPresentationRequest($query_params);
42 $this->user = $user;
43 $this->ref_id = $this->request->getRequestedRefId();
44 $this->lm_set = new ilSetting("lm");
45 $this->lm_gui = new ilObjLearningModuleGUI([], $this->ref_id, true, false);
46 $this->lm = $this->lm_gui->object;
47 $this->lm_tree = ilLMTree::getInstance($this->lm->getId());
48 $this->presentation_status = new ilLMPresentationStatus(
49 $user,
50 $this->lm,
51 $this->lm_tree,
52 $this->request->getRequestedTranslation(),
53 $this->request->getRequestedFocusId(),
54 $this->request->getRequestedFocusReturn(),
55 (string) $this->request->getRequestedSearchString(),
56 $offline,
57 $export_all_languages,
58 $export_format,
59 $embed_mode
60 );
61
62 $this->navigation_status = new ilLMNavigationStatus(
63 $user,
64 (int) $this->request->getRequestedObjId(),
65 $this->lm_tree,
66 $this->lm,
67 $this->lm_set,
68 $this->request->getRequestedBackPage(),
69 $this->request->getRequestedCmd(),
70 (int) $this->request->getRequestedFocusId()
71 );
72
73 $this->tracker = ilLMTracker::getInstance($this->lm->getRefId());
74 $this->tracker->setCurrentPage($this->navigation_status->getCurrentPage());
75
76 $this->linker = new ilLMPresentationLinker(
77 $this->lm,
78 $this->lm_tree,
79 $this->navigation_status->getCurrentPage(),
80 $this->request->getRequestedRefId(),
81 $this->presentation_status->getLang(),
82 $this->request->getRequestedBackPage(),
83 $this->request->getRequestedFromPage(),
84 $this->presentation_status->offline(),
85 $this->presentation_status->getExportFormat(),
86 $this->presentation_status->exportAllLanguages(),
87 $ctrl,
88 $embed_mode
89 );
90 }
91
97 public function getSettings() : ilSetting
98 {
99 return $this->lm_set;
100 }
101
106 {
107 return $this->lm_gui;
108 }
109
114 {
115 return $this->lm;
116 }
117
121 public function getLMTree() : ilLMTree
122 {
123 return $this->lm_tree;
124 }
125
130 {
131 return $this->presentation_status;
132 }
133
138 {
139 return $this->navigation_status;
140 }
141
147 public function getTracker()
148 {
149 return $this->tracker;
150 }
151
157 public function getRequest()
158 {
159 return $this->request;
160 }
161
167 public function getLinker()
168 {
169 return $this->linker;
170 }
171}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
Checks current navigation request status.
Learning module presentation linker.
Learning module presentation request.
Main service init and factory.
getSettings()
Get learning module settings.
__construct(ilObjUser $user, array $query_params, bool $offline=false, bool $export_all_languages=false, string $export_format="", ilCtrl $ctrl=null, bool $embed_mode=false)
Constructor.
Contains info on offline mode, focus, translation, etc.
static getInstance($a_ref_id, $a_user_id=0)
Get instance.
static getInstance($a_tree_id)
Get Instance.
Class ilLearningModuleGUI.
Class ilObjLearningModule.
ILIAS Setting Class.
global $DIC
Definition: goto.php:24
$lm_set