ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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("ilrepositorygui", "ref_id", $this->ref_id);
50  $cmd_link = $this->ctrl->getLinkTargetByClass(
51  [ilRepositoryGUI::class, ilObjFileBasedLMGUI::class],
53  );
54  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
55  break;
56 
57  default:
58  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
59  $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $cmd);
60  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
61  break;
62  }
63 
64  return $cmd_link;
65  }
66 
67  public function getCommandFrame(string $cmd): string
68  {
69  switch ($cmd) {
70  case "view":
71  $frame = "ilContObj" . $this->obj_id;
72  break;
73 
74  case "edit":
75  $frame = ilFrameTargetInfo::_getFrame("MainContent");
76  break;
77 
78  default:
79  $frame = "";
80  break;
81  }
82 
83  return $frame;
84  }
85 
86  public function getProperties(): array
87  {
88  $lng = $this->lng;
90 
91  // centralized offline status
92  $props = parent::getProperties();
93 
94  if (!ilObjFileBasedLMAccess::_determineStartUrl($this->obj_id)) {
95  $props[] = array("alert" => true, "property" => $lng->txt("status"),
96  "value" => $lng->txt("no_start_file"));
97  }
98 
99  if ($rbacsystem->checkAccess("write", $this->ref_id)) {
100  $props[] = array("alert" => false, "property" => $lng->txt("type"),
101  "value" => $lng->txt("htlm"));
102  }
103 
104  return $props;
105  }
106 
107  public function getInfoScreenStatus(): bool
108  {
109  return ilObjFileBasedLMAccess::isInfoEnabled($this->obj_id);
110  }
111 
112  public function checkInfoPageOnAsynchronousRendering(): bool
113  {
114  return true;
115  }
116 }
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...
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 ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
enableLearningProgress(bool $enabled)
static _getFrame(string $a_class)