ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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 switch ($cmd) {
44 case "view":
45 $cmd_link = "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->ref_id;
46 break;
47
48 case "edit":
49 $this->ctrl->setParameterByClass("ilObjFileBasedLMGUI", "ref_id", $this->ref_id);
50 $cmd_link = $this->ctrl->getLinkTargetByClass(
51 [ilRepositoryGUI::class, ilObjFileBasedLMGUI::class],
53 );
54 break;
55
56 default:
57 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
58 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $cmd);
59 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
60 break;
61 }
62
63 return $cmd_link;
64 }
65
66 public function getCommandFrame(string $cmd): string
67 {
68 switch ($cmd) {
69 case "view":
70 $frame = "ilContObj" . $this->obj_id;
71 break;
72
73 case "edit":
74 $frame = ilFrameTargetInfo::_getFrame("MainContent");
75 break;
76
77 default:
78 $frame = "";
79 break;
80 }
81
82 return $frame;
83 }
84
85 public function getProperties(): array
86 {
89
90 // centralized offline status
91 $props = parent::getProperties();
92
94 $props[] = array("alert" => true, "property" => $lng->txt("status"),
95 "value" => $lng->txt("no_start_file"));
96 }
97
98 if ($rbacsystem->checkAccess("write", $this->ref_id)) {
99 $props[] = array("alert" => false, "property" => $lng->txt("type"),
100 "value" => $lng->txt("htlm"));
101 }
102
103 return $props;
104 }
105
106 public function getInfoScreenStatus(): bool
107 {
108 return ilObjFileBasedLMAccess::isInfoEnabled($this->obj_id);
109 }
110
112 {
113 return true;
114 }
115}
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)
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 ...