ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjSAHSLearningModuleListGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
30{
35 public function __construct()
36 {
38 }
39
45 public function init(): void
46 {
47 $this->copy_enabled = true;
48 $this->delete_enabled = true;
49 $this->cut_enabled = true;
50 $this->subscribe_enabled = true;
51 $this->link_enabled = true;
52 $this->info_screen_enabled = true;
53 $this->type = "sahs";
54 $this->gui_class_name = "ilobjsahslearningmodulegui";
55 }
56
60 public function initItem(int $ref_id, int $obj_id, string $type, string $title = "", string $description = ""): void
61 {
62 // general commands array
64 parent::initItem($ref_id, $obj_id, $type, $title, $description);
65 }
66
74 public function getCommandLink(string $cmd): string
75 {
76 global $DIC;
77 $ilCtrl = $DIC->ctrl();
78 $cmd_link = null;
79 switch ($cmd) {
80 case "view":
81 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id;
82 break;
83
84 case "edit":
85 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id;
86 break;
87
88 case "infoScreen":
89 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=infoScreen";
90 break;
91
92 default:
93 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
94 $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $cmd);
95 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
96 break;
97 }
98 return $cmd_link;
99 }
100
101
102 // /**
103 // * Get command target frame
104 // *
105 // * @param string $a_cmd command
106 // *
107 // * @return string command target frame
108 // */
109 // public function getCommandFrame($a_cmd) : string
110 // {
111 // switch ($a_cmd) {
112 // case "view":
113 // $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
114 // $frame = "ilContObj" . $this->obj_id;
115 // break;
116 //
117 // case "edit":
119 // case "infoScreen":
120 // $frame = ilFrameTargetInfo::_getFrame("MainContent");
121 // break;
122 //
123 // default:
124 // $frame = "";
125 // break;
126 // }
127 //
128 // return $frame;
129 // }
130
131
140 public function getProperties(): array
141 {
142 global $DIC;
143 $lng = $DIC->language();
144 $rbacsystem = $DIC->access();
145 $props = parent::getProperties();
146
147 if ($rbacsystem->checkAccess("write", "", $this->ref_id)) {
148 $props[] = array("alert" => false, "property" => $lng->txt("type"),
149 "value" => $lng->txt("sahs"));
150 }
151
152 $certValidator = new ilCertificateDownloadValidator();
153 $allowed = $certValidator->isCertificateDownloadable($this->user->getId(), $this->obj_id);
154 if ($allowed) {
156 $lng->loadLanguageModule('certificate');
157 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->ref_id . "&cmd=downloadCertificate";
158 $props[] = [
159 'alert' => false,
160 'property' => $lng->txt('certificate'),
161 'value' => $DIC->ui()->renderer()->render(
162 $DIC->ui()->factory()->link()->standard($lng->txt('download_certificate'), $cmd_link)
163 )
164 ];
165 }
166
167 return $props;
168 }
169} // END class.ilObjCategoryGUI
Validates if an active certificate is stored in the database and can be downloaded by the user.
loadLanguageModule(string $a_module)
Load language module.
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...
Class ilObjSAHSLearningModuleListGUI.
getCommandLink(string $cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.
initItem(int $ref_id, int $obj_id, string $type, string $title="", string $description="")
initialize new item (is called by getItemHTML())
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
static _getCommands()
get commands
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 ...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26