ILIAS  release_8 Revision v8.24
class.ilObjFileBasedLMListGUI.php
Go to the documentation of this file.
1<?php
2
24{
25 public function init(): void
26 {
27 $this->copy_enabled = true;
28 $this->delete_enabled = true;
29 $this->cut_enabled = true;
30 $this->subscribe_enabled = true;
31 $this->link_enabled = true;
32 $this->info_screen_enabled = true;
33 $this->type = "htlm";
34 $this->gui_class_name = "ilobjfilebasedlmgui";
35 $this->enableLearningProgress(true);
36
37 // general commands array
38 $this->commands = ilObjFileBasedLMAccess::_getCommands();
39 }
40
41 public function getCommandLink(string $cmd): string
42 {
43 $ilCtrl = $this->ctrl;
44
45 switch ($cmd) {
46 case "view":
47 $cmd_link = "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->ref_id;
48 break;
49
50 case "edit":
51 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
52 $cmd_link = $ilCtrl->getLinkTargetByClass(
53 ["ilrepositorygui", "ilObjFileBasedLMGUI", "ilFileSystemGUI"],
54 "listFiles"
55 );
56 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
57 break;
58
59 default:
60 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
61 $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $cmd);
62 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
63 break;
64 }
65
66 return $cmd_link;
67 }
68
69 public function getCommandFrame(string $cmd): string
70 {
71 switch ($cmd) {
72 case "view":
73 $frame = "ilContObj" . $this->obj_id;
74 break;
75
76 case "edit":
77 $frame = ilFrameTargetInfo::_getFrame("MainContent");
78 break;
79
80 default:
81 $frame = "";
82 break;
83 }
84
85 return $frame;
86 }
87
88 public function getProperties(): array
89 {
92
93 // centralized offline status
94 $props = parent::getProperties();
95
97 $props[] = array("alert" => true, "property" => $lng->txt("status"),
98 "value" => $lng->txt("no_start_file"));
99 }
100
101 if ($rbacsystem->checkAccess("write", $this->ref_id)) {
102 $props[] = array("alert" => false, "property" => $lng->txt("type"),
103 "value" => $lng->txt("htlm"));
104 }
105
106 return $props;
107 }
108
109 public function getInfoScreenStatus(): bool
110 {
111 return ilObjFileBasedLMAccess::isInfoEnabled($this->obj_id);
112 }
113
115 {
116 return true;
117 }
118}
static _getFrame(string $a_class)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCommandLink(string $cmd)
Get command link url.
getCommandFrame(string $cmd)
Get command target frame.
enableLearningProgress(bool $enabled)
ilCtrlInterface $ctrl
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...