ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LearningModule\Menu\ilLMMenuGUI Class Reference
+ Collaboration diagram for ILIAS\LearningModule\Menu\ilLMMenuGUI:

Public Member Functions

 __construct (\ilLMPresentationService $lm_pres_service)
 
 getEntries ()
 

Protected Attributes

bool $offline
 
ilLMPresentationService $service
 
ilCtrl $ctrl
 
ILIAS DI UIServices $ui
 
ilObjLearningModule $lm
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilObjUser $user
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\Menu\ilLMMenuGUI::__construct ( \ilLMPresentationService  $lm_pres_service)

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

39 {
40 global $DIC;
41
42 $this->ui = $DIC->ui();
43 $this->ctrl = $DIC->ctrl();
44 $this->service = $lm_pres_service;
45 $this->lng = $DIC->language();
46 $this->access = $DIC->access();
47 $this->lm = $this->service->getLearningModule();
48 $this->offline = $lm_pres_service->getPresentationStatus()->offline();
49 $this->user = $DIC->user();
50 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLMPresentationService\getPresentationStatus(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getEntries()

ILIAS\LearningModule\Menu\ilLMMenuGUI::getEntries ( )

Definition at line 52 of file class.ilLMMenuGUI.php.

52 : array
53 {
54 $ui = $this->ui;
59
60 $entries = [];
61
62 $ctrl->setParameterByClass("illmpresentationgui", 'ref_id', $this->lm->getRefId());
63
64 // print selection
65 if ($this->lm->isActivePrintView() && $access->checkAccess("read", "", $this->lm->getRefId())) {
66 if (!$this->offline) {
67 $ui->mainTemplate()->addJavaScript("assets/js/Form.js");
68 $modal = $ui->factory()->modal()->roundtrip(
69 $lng->txt("cont_print_view"),
70 $ui->factory()->legacy()->content('some modal')
71 )->withAsyncRenderUrl($this->ctrl->getLinkTargetByClass("illmpresentationgui", "showPrintViewSelection"));
72
73 $entries[] = [
74 "label" => $this->lng->txt("cont_print_view"),
75 "signal" => $modal->getShowSignal(),
76 "modal" => $modal,
77 "on_load" => ""
78 ];
79 }
80 }
81
82 // user defined menu entries
83 $menu_editor = new \ilLMMenuEditor();
84 $menu_editor->setObjId($this->lm->getId());
85
86 $cust_menu = $menu_editor->getMenuEntries(true);
87 $generator = new SignalGenerator();
88 if (count($cust_menu) > 0 && $access->checkAccess("read", "", $this->lm->getRefId())) {
89 foreach ($cust_menu as $entry) {
90 // build goto-link for internal resources
91 if ($entry["type"] == "intern") {
92 $entry["link"] = ILIAS_HTTP_PATH . "/goto.php?target=" . $entry["link"];
93 }
94
95 // add http:// prefix if not exist
96 if (!strstr($entry["link"], '://') && !strstr($entry["link"], 'mailto:')) {
97 $entry["link"] = "https://" . $entry["link"];
98 }
99
100 if (!strstr($entry["link"], 'mailto:')) {
101 $entry["link"] = \ilUtil::appendUrlParameterString($entry["link"], "ref_id=" . $this->lm->getRefId());
102 }
103
104 $signal = $generator->create();
105
106 $entries[] = [
107 "label" => $entry["title"],
108 "signal" => $signal,
109 "modal" => null,
110 "on_load" => "$(document).on('" .
111 $signal->getId() .
112 "', function(event, signalData) {il.LearningModule.openMenuLink('" . $entry["link"] . "');});"
113 ];
114 }
115 }
116
117
118 return $entries;
119 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)

References ILIAS\LearningModule\Menu\ilLMMenuGUI\$access, ILIAS\LearningModule\Menu\ilLMMenuGUI\$ctrl, ILIAS\LearningModule\Menu\ilLMMenuGUI\$lng, ILIAS\LearningModule\Menu\ilLMMenuGUI\$ui, ILIAS\LearningModule\Menu\ilLMMenuGUI\$user, ilUtil\appendUrlParameterString(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilCtrl\setParameterByClass(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ILIAS\LearningModule\Menu\ilLMMenuGUI::$access
protected

◆ $ctrl

ilCtrl ILIAS\LearningModule\Menu\ilLMMenuGUI::$ctrl
protected

◆ $lm

ilObjLearningModule ILIAS\LearningModule\Menu\ilLMMenuGUI::$lm
protected

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

◆ $lng

ilLanguage ILIAS\LearningModule\Menu\ilLMMenuGUI::$lng
protected

◆ $offline

bool ILIAS\LearningModule\Menu\ilLMMenuGUI::$offline
protected

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

◆ $service

ilLMPresentationService ILIAS\LearningModule\Menu\ilLMMenuGUI::$service
protected

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

◆ $ui

ILIAS DI UIServices ILIAS\LearningModule\Menu\ilLMMenuGUI::$ui
protected

◆ $user

ilObjUser ILIAS\LearningModule\Menu\ilLMMenuGUI::$user
protected

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