ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLMMenuRendererGUI Class Reference

Menu / Tabs renderer. More...

+ Collaboration diagram for ilLMMenuRendererGUI:

Public Member Functions

 render ()
 Render. More...
 

Protected Attributes

 $access
 
 $user
 
 $current_page
 
 $lm
 
 $offline
 
 $ctrl
 
 $lang
 
 $active_tab
 
 $export_format
 
 $tabs
 
 $toolbar
 
 $menu_editor
 
 $lm_pres_service
 
 $main_tpl
 
 $ui_factory
 
 $additional_content_collector
 

Detailed Description

Menu / Tabs renderer.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 10 of file class.ilLMMenuRendererGUI.php.

Member Function Documentation

◆ render()

ilLMMenuRendererGUI::render ( )

Render.

Returns
string

Definition at line 148 of file class.ilLMMenuRendererGUI.php.

149 {
150 $ilCtrl = $this->ctrl;
151 $ilAccess = $this->access;
152 $ilTabs = $this->tabs;
153
154 $getcmd = "getHTML";
155
156 $active[$this->active_tab] = true;
157
158 if (!$this->lm->isActiveLMMenu()) {
159 return "";
160 }
161
162 $tabs_gui = $ilTabs;
163
164 // workaround for preventing tooltips in export
165 if ($this->offline) {
166 $tabs_gui->setSetupMode(true);
167 }
168
169 // content
170 if (!$this->offline && $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
171 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
172 if (!$active["content"]) {
173 $this->toolbar->addComponent(
174 $this->ui_factory->button()->standard($this->lng->txt("content"), $ilCtrl->getLinkTargetByClass("illmpresentationgui", "layout"))
175 );
176 }
177 } elseif ($this->offline) {
178 $tabs_gui->setForcePresentationOfSingleTab(true);
179 }
180
181 if (!$active["content"]) {
182 return;
183 }
184
185 // info button
186 if ($this->export_format != "scorm" && !$this->offline) {
187 if (!$this->offline) {
188 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
189 $link = $this->ctrl->getLinkTargetByClass(
190 array("illmpresentationgui", "ilinfoscreengui"),
191 "showSummary"
192 );
193 } else {
194 $link = "./info.html";
195 }
196 $this->toolbar->addComponent(
197 $this->ui_factory->button()->standard($this->lng->txt("info_short"), $link)
198 );
199 }
200
201 if (!$this->offline &&
202 $ilAccess->checkAccess("read", "", $this->requested_ref_id) && // #14075
203 ilLearningProgressAccess::checkAccess($this->requested_ref_id)) {
204
205 $olp = ilObjectLP::getInstance($this->lm->getId());
206
207 if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL) {
208 $this->toolbar->addComponent(
209 $this->ui_factory->button()->standard($this->lng->txt("learning_progress"),
210 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "editManual"))
211 );
212
213 } elseif ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
214 $this->toolbar->addComponent(
215 $this->ui_factory->button()->standard($this->lng->txt("learning_progress"),
216 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "showtlt")
217 ));
218 }
219 }
220
221 // default entries (appearing in lsq and native mode)
222 $menu = new \ILIAS\LearningModule\Menu\ilLMMenuGUI($this->lm_pres_service);
223 foreach ($menu->getEntries() as $entry) {
224 if (is_object($entry["signal"])) {
225 $this->toolbar->addComponent(
226 $this->ui_factory->button()->standard($entry["label"], '')
227 ->withOnClick($entry["signal"]));
228 }
229 if (is_object($entry["modal"])) {
230 ($this->additional_content_collector)($entry["modal"]);
231 }
232 if ($entry["on_load"] != "") {
233 $this->main_tpl->addOnLoadCode($entry["on_load"]);
234 }
235 }
236
237 // edit learning module
238 if (!$this->offline) {
239 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
240 if ($this->current_page <= 0) {
241 $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
242 } else {
243 $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
244 "&obj_id=" . $this->current_page . "&to_page=1";
245 }
246 $this->toolbar->addComponent(
247 $this->ui_factory->button()->standard($this->lng->txt("edit_page"),
248 $link
249 ));
250
251 }
252 }
253
254 return $tabs_gui->$getcmd();
255 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static getInstance($a_obj_id)

References $access, $active_tab, $additional_content_collector, $ctrl, $tabs, ilLearningProgressAccess\checkAccess(), ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, and ilLPObjSettings\LP_MODE_COLLECTION_TLT.

Referenced by ilLMPresentationGUI\renderTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilLMMenuRendererGUI::$access
protected

Definition at line 15 of file class.ilLMMenuRendererGUI.php.

Referenced by render().

◆ $active_tab

ilLMMenuRendererGUI::$active_tab
protected

Definition at line 51 of file class.ilLMMenuRendererGUI.php.

Referenced by render().

◆ $additional_content_collector

ilLMMenuRendererGUI::$additional_content_collector
protected

Definition at line 91 of file class.ilLMMenuRendererGUI.php.

Referenced by render().

◆ $ctrl

ilLMMenuRendererGUI::$ctrl
protected

Definition at line 40 of file class.ilLMMenuRendererGUI.php.

Referenced by render().

◆ $current_page

ilLMMenuRendererGUI::$current_page
protected

Definition at line 25 of file class.ilLMMenuRendererGUI.php.

◆ $export_format

ilLMMenuRendererGUI::$export_format
protected

Definition at line 56 of file class.ilLMMenuRendererGUI.php.

◆ $lang

ilLMMenuRendererGUI::$lang
protected

Definition at line 46 of file class.ilLMMenuRendererGUI.php.

◆ $lm

ilLMMenuRendererGUI::$lm
protected

Definition at line 30 of file class.ilLMMenuRendererGUI.php.

◆ $lm_pres_service

ilLMMenuRendererGUI::$lm_pres_service
protected

Definition at line 76 of file class.ilLMMenuRendererGUI.php.

◆ $main_tpl

ilLMMenuRendererGUI::$main_tpl
protected

Definition at line 81 of file class.ilLMMenuRendererGUI.php.

◆ $menu_editor

ilLMMenuRendererGUI::$menu_editor
protected

Definition at line 71 of file class.ilLMMenuRendererGUI.php.

◆ $offline

ilLMMenuRendererGUI::$offline
protected

Definition at line 35 of file class.ilLMMenuRendererGUI.php.

◆ $tabs

ilLMMenuRendererGUI::$tabs
protected

Definition at line 61 of file class.ilLMMenuRendererGUI.php.

Referenced by render().

◆ $toolbar

ilLMMenuRendererGUI::$toolbar
protected

Definition at line 66 of file class.ilLMMenuRendererGUI.php.

◆ $ui_factory

ilLMMenuRendererGUI::$ui_factory
protected

Definition at line 86 of file class.ilLMMenuRendererGUI.php.

◆ $user

ilLMMenuRendererGUI::$user
protected

Definition at line 20 of file class.ilLMMenuRendererGUI.php.


The documentation for this class was generated from the following file: