ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ) {
34 global $DIC;
35
36 $ctrl = (is_null($ctrl))
37 ? $DIC->ctrl()
38 : $ctrl;
39
40 $this->request = new ilLMPresentationRequest($query_params);
41 $this->user = $user;
42 $this->ref_id = $this->request->getRequestedRefId();
43 $this->lm_set = new ilSetting("lm");
44 $this->lm_gui = new ilObjLearningModuleGUI([], $this->ref_id, true, false);
45 $this->lm = $this->lm_gui->object;
46 $this->lm_tree = ilLMTree::getInstance($this->lm->getId());
47 $this->presentation_status = new ilLMPresentationStatus(
48 $user,
49 $this->lm,
50 $this->lm_tree,
51 $this->request->getRequestedTranslation(),
52 $this->request->getRequestedFocusId(),
53 $this->request->getRequestedFocusReturn(),
54 (string) $this->request->getRequestedSearchString(),
55 $offline,
56 $export_all_languages,
57 $export_format
58 );
59
60 $this->navigation_status = new ilLMNavigationStatus(
61 $user,
62 (int) $this->request->getRequestedObjId(),
63 $this->lm_tree,
64 $this->lm,
65 $this->lm_set,
66 $this->request->getRequestedCmd(),
67 (int) $this->request->getRequestedFocusId()
68 );
69
70 $this->tracker = ilLMTracker::getInstance($this->lm->getRefId());
71 $this->tracker->setCurrentPage($this->navigation_status->getCurrentPage());
72
73 $this->linker = new ilLMPresentationLinker(
74 $this->lm,
75 $this->lm_tree,
76 $this->navigation_status->getCurrentPage(),
77 $this->request->getRequestedRefId(),
78 $this->presentation_status->getLang(),
79 $this->request->getRequestedBackPage(),
80 $this->request->getRequestedFromPage(),
81 $this->presentation_status->offline(),
82 $this->presentation_status->getExportFormat(),
83 $this->presentation_status->exportAllLanguages(),
84 $ctrl
85 );
86 }
87
93 public function getSettings() : ilSetting
94 {
95 return $this->lm_set;
96 }
97
102 {
103 return $this->lm_gui;
104 }
105
110 {
111 return $this->lm;
112 }
113
117 public function getLMTree() : ilLMTree
118 {
119 return $this->lm_tree;
120 }
121
126 {
127 return $this->presentation_status;
128 }
129
134 {
135 return $this->navigation_status;
136 }
137
143 public function getTracker()
144 {
145 return $this->tracker;
146 }
147
153 public function getRequest()
154 {
155 return $this->request;
156 }
157
163 public function getLinker()
164 {
165 return $this->linker;
166 }
167}
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)
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.
$lm_set
$DIC
Definition: xapitoken.php:46