ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLMMenuRendererGUI Class Reference

Menu / Tabs renderer. More...

+ Collaboration diagram for ilLMMenuRendererGUI:

Public Member Functions

 __construct (ilTabsGUI $tabs, int $current_page, string $active_tab, string $export_format, bool $export_all, ilObjLearningModule $lm, bool $offline, ilLMMenuEditor $menu_editor, string $lang, ilCtrl $ctrl, ilAccessHandler $access, ilObjUser $user, ilLanguage $lng)
 Constructor. More...
 
 render ()
 Render. More...
 

Protected Attributes

 $access
 
 $user
 
 $current_page
 
 $lm
 
 $offline
 
 $ctrl
 
 $lang
 
 $active_tab
 
 $export_format
 
 $tabs
 
 $menu_editor
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilLMMenuRendererGUI::__construct ( ilTabsGUI  $tabs,
int  $current_page,
string  $active_tab,
string  $export_format,
bool  $export_all,
ilObjLearningModule  $lm,
bool  $offline,
ilLMMenuEditor  $menu_editor,
string  $lang,
ilCtrl  $ctrl,
ilAccessHandler  $access,
ilObjUser  $user,
ilLanguage  $lng 
)

Constructor.

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

85 {
86 $this->active_tab = $active_tab;
87 $this->export_format = $export_format;
88 $this->export_all = $export_all;
89 $this->tabs = $tabs;
90 $this->menu_editor = $menu_editor;
91 $this->lng = $lng;
92
93 $this->access = $access;
94 $this->user = $user;
95 $this->ctrl = $ctrl;
96 $this->lang = $lang;
97 $this->current_page = $current_page;
98 $this->lm = $lm;
99 $this->offline = $offline;
100
101 $this->requested_obj_id = (int) $_GET["obj_id"];
102 $this->requested_ref_id = (int) $_GET["ref_id"];
103 }
user()
Definition: user.php:4
$_GET["client_id"]
$lng

References $_GET, $access, $active_tab, $ctrl, $current_page, $export_format, $lang, $lm, $lng, $menu_editor, $offline, $tabs, $user, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ render()

ilLMMenuRendererGUI::render ( )

Render.

Returns
string

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

111 {
114 $ilAccess = $this->access;
115 $ilTabs = $this->tabs;
116
117 $addcmd = "addTarget";
118 $getcmd = "getHTML";
119
120 //$ilHelp->setScreenIdComponent("lm");
121
122 $active[$this->active_tab] = true;
123
124 if (!$this->lm->isActiveLMMenu()) {
125 return "";
126 }
127
128 $tabs_gui = $ilTabs;
129
130 // workaround for preventing tooltips in export
131 if ($this->offline) {
132 $tabs_gui->setSetupMode(true);
133 }
134
135 // Determine whether the view of a learning resource should
136 // be shown in the frameset of ilias, or in a separate window.
137 //$showViewInFrameset = true;
138
139
140 // content
141 if (!$this->offline && $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
142 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
143 $tabs_gui->$addcmd(
144 "content",
145 $ilCtrl->getLinkTargetByClass("illmpresentationgui", "layout"),
146 "",
147 "",
148 "",
149 $active["content"]
150 );
151 /*
152 if ($active["content"])
153 {
154 $ilHelp->setScreenId("content");
155 $ilHelp->setSubScreenId("content");
156 }*/
157 } elseif ($this->offline) {
158 $tabs_gui->setForcePresentationOfSingleTab(true);
159 }
160
161 // table of contents
162 /*
163 if($this->lm->isActiveTOC() && $ilAccess->checkAccess("read", "", $this->requested_ref_id))
164 {
165 if (!$this->offline)
166 {
167 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
168 $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showTableOfContents");
169 }
170 else
171 {
172 if ($this->export_all)
173 {
174 $link = "./table_of_contents_".$this->lang.".html";
175 }
176 else
177 {
178 $link = "./table_of_contents.html";
179 }
180 }
181 $tabs_gui->$addcmd("cont_toc", $link,
182 "", "", "", $active["toc"]);
183 }*/
184
185 // print view
186 if ($this->lm->isActivePrintView() && $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
187 if (!$this->offline) { // has to be implemented for offline mode
188 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
189 $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showPrintViewSelection");
190 $tabs_gui->$addcmd(
191 "cont_print_view",
192 $link,
193 "",
194 "",
195 "",
196 $active["print"]
197 );
198 }
199 }
200
201 // download
202 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
203 $is_public = $this->lm->isActiveDownloadsPublic();
204 } else {
205 $is_public = true;
206 }
207
208 if ($this->lm->isActiveDownloads() && !$this->offline && $is_public &&
209 $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
210 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
211 $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showDownloadList");
212 $tabs_gui->$addcmd(
213 "download",
214 $link,
215 "",
216 "",
217 "",
218 $active["download"]
219 );
220 }
221
222 // info button
223 if ($this->export_format != "scorm" && !$this->offline) {
224 if (!$this->offline) {
225 $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $this->requested_obj_id);
226 $link = $this->ctrl->getLinkTargetByClass(
227 array("illmpresentationgui", "ilinfoscreengui"),
228 "showSummary"
229 );
230 } else {
231 $link = "./info.html";
232 }
233
234 $tabs_gui->$addcmd(
235 'info_short',
236 $link,
237 "",
238 "",
239 "",
240 $active["info"]
241 );
242 }
243
244 if (!$this->offline &&
245 $ilAccess->checkAccess("read", "", $this->requested_ref_id) && // #14075
246 ilLearningProgressAccess::checkAccess($this->requested_ref_id)) {
247 $olp = ilObjectLP::getInstance($this->lm->getId());
248 if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL) {
249 $tabs_gui->$addcmd(
250 "learning_progress",
251 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "editManual"),
252 "",
253 "",
254 "",
255 $active["learning_progress"]
256 );
257 } elseif ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
258 $tabs_gui->$addcmd(
259 "learning_progress",
260 $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "showtlt"),
261 "",
262 "",
263 "",
264 $active["learning_progress"]
265 );
266 }
267 }
268
269 // get user defined menu entries
270 $entries = $this->menu_editor->getMenuEntries(true);
271 if (count($entries) > 0 && $ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
272 foreach ($entries as $entry) {
273 // build goto-link for internal resources
274 if ($entry["type"] == "intern") {
275 $entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"];
276 }
277
278 // add http:// prefix if not exist
279 if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) {
280 $entry["link"] = "http://" . $entry["link"];
281 }
282
283 if (!strstr($entry["link"], 'mailto:')) {
284 $entry["link"] = ilUtil::appendUrlParameterString($entry["link"], "ref_id=" .
285 $this->requested_ref_id . "&structure_id=" . $this->requested_obj_id);
286 }
287 $tabs_gui->$addcmd(
288 $entry["title"],
289 $entry["link"],
290 "",
291 "",
292 "_blank",
293 "",
294 true
295 );
296 }
297 }
298
299 // edit learning module
300 if (!$this->offline) {
301 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
302 if ($this->current_page <= 0) {
303 $link = $this->ctrl->getLinkTargetByClass(["ilLMEditorGUI", "ilobjlearningmodulegui"], "chapters");
304 } else {
305 $link = ILIAS_HTTP_PATH . "/ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $this->requested_ref_id .
306 "&obj_id=" . $this->current_page . "&to_page=1";
307 }
308 $tabs_gui->addNonTabbedLink(
309 "edit_page",
310 $this->lng->txt("lm_editing_view"),
311 $link
312 );
313 }
314 }
315
316 // user interface hook [uihk]
317 /*
318 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
319 $plugin_html = false;
320 foreach ($pl_names as $pl)
321 {
322 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
323 $gui_class = $ui_plugin->getUIClassInstance();
324 $resp = $gui_class->modifyGUI("Modules/LearningModule", "lm_menu_tabs",
325 array("lm_menu_tabs" => $tabs_gui));
326 }*/
327
328 return $tabs_gui->$getcmd();
329 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static getInstance($a_obj_id)
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18

References $access, $active_tab, $ctrl, $ilCtrl, $ilUser, $tabs, $user, ilUtil\appendUrlParameterString(), ilLearningProgressAccess\checkAccess(), ilObjectLP\getInstance(), ILIAS_HTTP_PATH, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, and ilLPObjSettings\LP_MODE_COLLECTION_TLT.

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilLMMenuRendererGUI::$access
protected

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

Referenced by __construct(), and render().

◆ $active_tab

ilLMMenuRendererGUI::$active_tab
protected

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

Referenced by __construct(), and render().

◆ $ctrl

ilLMMenuRendererGUI::$ctrl
protected

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

Referenced by __construct(), and render().

◆ $current_page

ilLMMenuRendererGUI::$current_page
protected

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

Referenced by __construct().

◆ $export_format

ilLMMenuRendererGUI::$export_format
protected

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

Referenced by __construct().

◆ $lang

ilLMMenuRendererGUI::$lang
protected

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

Referenced by __construct().

◆ $lm

ilLMMenuRendererGUI::$lm
protected

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

Referenced by __construct().

◆ $menu_editor

ilLMMenuRendererGUI::$menu_editor
protected

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

Referenced by __construct().

◆ $offline

ilLMMenuRendererGUI::$offline
protected

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

Referenced by __construct().

◆ $tabs

ilLMMenuRendererGUI::$tabs
protected

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

Referenced by __construct(), and render().

◆ $user

ilLMMenuRendererGUI::$user
protected

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

Referenced by __construct(), and render().


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