ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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;
37  protected ilLMTracker $tracker;
38 
39  public function __construct(
40  ilObjUser $user,
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(),
93  $this->lm,
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 }
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...
ilLMPresentationStatus $presentation_status
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
static getInstance(int $a_ref_id, int $a_user_id=0)
getSettings()
Get learning module settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$post
Definition: ltitoken.php:46
Main service init and factory.