ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLMMenuRendererGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLMMenuRendererGUI:

Public Member Functions

 render ()
 

Protected Attributes

ilLanguage $lng
 
bool $export_all
 
int $requested_ref_id
 
int $requested_obj_id
 
ilAccessHandler $access
 
ilObjUser $user
 
int $current_page
 
ilObjLearningModule $lm
 
bool $offline
 
ilCtrl $ctrl
 
string $lang
 
string $active_tab
 
string $export_format
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilLMMenuEditor $menu_editor
 
ilLMPresentationService $lm_pres_service
 
ilGlobalTemplateInterface $main_tpl
 
ILIAS UI Factory $ui_factory
 
Closure $additional_content_collector
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Menu / Tabs renderer

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

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

Member Function Documentation

◆ render()

ilLMMenuRendererGUI::render ( )

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

93 : string
94 {
95 $ilCtrl = $this->ctrl;
96 $ilAccess = $this->access;
97 $ilTabs = $this->tabs;
98 $actions = [];
99
100 $getcmd = "getHTML";
101
102 $content_active = ($this->active_tab === "content");
103
104 if (!$this->lm->isActiveLMMenu()) {
105 return "";
106 }
107
108 $tabs_gui = $ilTabs;
109
110 // workaround for preventing tooltips in export
111 if ($this->offline) {
112 $tabs_gui->setSetupMode(true);
113 }
114
115 // content
116 if (!$this->offline && $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
117 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
118 if (!$content_active) {
119 $this->toolbar->addStickyItem(
120 $this->ui_factory->button()->standard($this->lng->txt("content"), $ilCtrl->getLinkTargetByClass("illmpresentationgui", "layout"))
121 );
122 }
123 } elseif ($this->offline) {
124 $tabs_gui->setForcePresentationOfSingleTab(true);
125 }
126
127 if (!$content_active) {
128 return "";
129 }
130
131 // info button
132 if ($this->lm->isInfoEnabled()) {
133 if (!$this->offline) {
134 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
135 $link = $this->ctrl->getLinkTargetByClass(
136 array("illmpresentationgui", "ilinfoscreengui"),
137 "showSummary"
138 );
139 /*
140 $this->toolbar->addComponent(
141 $this->ui_factory->button()->standard($this->lng->txt("info_short"), $link)
142 );*/
143 $actions[] =
144 $this->ui_factory->button()->shy($this->lng->txt("info_short"), $link);
145 }
146 }
147 if (!$this->offline &&
148 $ilAccess->checkAccess("read", "", $this->requested_ref_id) && // #14075
149 ilLearningProgressAccess::checkAccess($this->requested_ref_id)) {
150 $olp = ilObjectLP::getInstance($this->lm->getId());
151 if ($olp->getCurrentMode() !== ilLPObjSettings::LP_MODE_COLLECTION_MANUAL) {
152 $this->toolbar->addComponent(
153 $this->ui_factory->button()->standard(
154 $this->lng->txt("learning_progress"),
155 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "")
156 )
157 );
158 } else {
159 $this->toolbar->addComponent(
160 $this->ui_factory->button()->standard(
161 $this->lng->txt("learning_progress"),
162 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "editManual")
163 )
164 );
165 } /* elseif ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
166 $this->toolbar->addComponent(
167 $this->ui_factory->button()->standard(
168 $this->lng->txt("learning_progress"),
169 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "showtlt")
170 )
171 );
172 }*/
173 }
174
175 // default entries (appearing in lsq and native mode)
176 $menu = new \ILIAS\LearningModule\Menu\ilLMMenuGUI($this->lm_pres_service);
177 foreach ($menu->getEntries() as $entry) {
178 if (is_object($entry["signal"])) {
179 if ($this->lm_pres_service->getPresentationStatus()->getEmbedMode()) {
180 $this->toolbar->addComponent(
181 $this->ui_factory->button()->standard($entry["label"], '')
182 ->withOnClick($entry["signal"])
183 );
184 } else {
185 $actions[] = $this->ui_factory->button()->shy($entry["label"], '')
186 ->withOnClick($entry["signal"]);
187 }
188 }
189 if (is_object($entry["modal"])) {
190 ($this->additional_content_collector)($entry["modal"]);
191 }
192 if ($entry["on_load"] != "") {
193 $this->main_tpl->addOnLoadCode($entry["on_load"]);
194 }
195 }
196
197 // edit learning module
198 if (!$this->offline) {
199 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
200
201 if ($this->current_page > 0) {
202 $actions[] = $this->ui_factory->button()->shy(
203 $this->lng->txt("edit_page"),
204 ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
205 "&obj_id=" . $this->current_page . "&to_page=1"
206 );
207 }
208 $actions[] = $this->ui_factory->button()->shy(
209 $this->lng->txt("lm_edit_chapters"),
210 $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters")
211 );
212 $actions[] = $this->ui_factory->button()->shy(
213 $this->lng->txt("lm_edit_lm_settings"),
214 $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "properties")
215 );
216 }
217 }
218 if (count($actions) > 0) {
219 $this->toolbar->addStickyItem(
220 $this->ui_factory->dropdown()->standard($actions)
221 );
222 }
223
224 return $tabs_gui->$getcmd();
225 }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static getInstance(int $obj_id)
setSetupMode(bool $a_val)

References $access, $additional_content_collector, $ctrl, $tabs, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ilObjectLP\getInstance(), ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilTabsGUI\setSetupMode(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilLMMenuRendererGUI::$access
protected

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

Referenced by render().

◆ $active_tab

string ilLMMenuRendererGUI::$active_tab
protected

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

◆ $additional_content_collector

Closure ilLMMenuRendererGUI::$additional_content_collector
protected

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

Referenced by render().

◆ $ctrl

ilCtrl ilLMMenuRendererGUI::$ctrl
protected

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

Referenced by render().

◆ $current_page

int ilLMMenuRendererGUI::$current_page
protected

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

◆ $export_all

bool ilLMMenuRendererGUI::$export_all
protected

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

◆ $export_format

string ilLMMenuRendererGUI::$export_format
protected

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

◆ $lang

string ilLMMenuRendererGUI::$lang
protected

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

◆ $lm

ilObjLearningModule ilLMMenuRendererGUI::$lm
protected

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

◆ $lm_pres_service

ilLMPresentationService ilLMMenuRendererGUI::$lm_pres_service
protected

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

◆ $lng

ilLanguage ilLMMenuRendererGUI::$lng
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilLMMenuRendererGUI::$main_tpl
protected

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

◆ $menu_editor

ilLMMenuEditor ilLMMenuRendererGUI::$menu_editor
protected

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

◆ $offline

bool ilLMMenuRendererGUI::$offline
protected

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

◆ $requested_obj_id

int ilLMMenuRendererGUI::$requested_obj_id
protected

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

◆ $requested_ref_id

int ilLMMenuRendererGUI::$requested_ref_id
protected

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

◆ $tabs

ilTabsGUI ilLMMenuRendererGUI::$tabs
protected

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

Referenced by render().

◆ $toolbar

ilToolbarGUI ilLMMenuRendererGUI::$toolbar
protected

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

◆ $ui_factory

ILIAS UI Factory ilLMMenuRendererGUI::$ui_factory
protected

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

◆ $user

ilObjUser ilLMMenuRendererGUI::$user
protected

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


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