ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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;
38  protected ilLMTracker $tracker;
39 
40  public function __construct(
41  ilObjUser $user,
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(),
95  $this->lm,
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 }
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
Contains info on offline mode, focus, translation, etc.
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:26
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...
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Main service init and factory.