ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjSAHSLearningModuleListGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "Services/Object/classes/class.ilObjectListGUI.php";
6
16{
21 public function __construct()
22 {
24 }
25
31 public function init()
32 {
33 $this->copy_enabled = true;
34 $this->delete_enabled = true;
35 $this->cut_enabled = true;
36 $this->subscribe_enabled = true;
37 $this->link_enabled = true;
38 $this->info_screen_enabled = true;
39 $this->type = "sahs";
40 $this->gui_class_name = "ilobjsahslearningmodulegui";
41 include_once('./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
42 }
43
47 public function initItem($a_ref_id, $a_obj_id, $type, $a_title = "", $a_description = "")
48 {
49 // general commands array
50 $this->commands = ilObjSAHSLearningModuleAccess::_getCommands($a_obj_id);
51 parent::initItem($a_ref_id, $a_obj_id, $type, $a_title, $a_description);
52 }
53
63 public function getCommandLink($a_cmd)
64 {
65 global $DIC;
66 $ilCtrl = $DIC['ilCtrl'];
67 $cmd_link = null;
68 switch ($a_cmd) {
69 case "view":
70 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
72 if ($this->offline_mode) {
73 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeStart";
74 } else {
75 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id;
76 }
77 } else {
78 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id;
79 }
80
81 break;
82 case "offlineModeView":
83 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeView";
84 break;
85
86 case "editContent":
87 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=editContent";
88 break;
89
90 case "edit":
91 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id;
92 break;
93
94 case "infoScreen":
95 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=infoScreen";
96 break;
97
98 case "offlineModeStart":
99 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeStart";
100// $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilsahspresentationgui', 'ilscormofflinemodegui'),'start&amp;ref_id='.$_GET["ref_id"]);
101 break;
102
103 case "offlineModeStop":
104 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmdClass=ilSCORMOfflineModeGUI&amp;cmd=stop";
105 break;
106
107 default:
108 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
109 $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
110 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
111 break;
112 }
113
114 return $cmd_link;
115 }
116
117
125 public function getCommandFrame($a_cmd)
126 {
127 global $DIC;
128 $ilias = $DIC['ilias'];
129
130 switch ($a_cmd) {
131 case "view":
132 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
133 $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
134 if ($this->offline_mode) {
135 $frame = ilFrameTargetInfo::_getFrame("MainContent");
136 } else {
137 $frame = "ilContObj" . $this->obj_id;
138 }
139 if ($sahs_obj->getEditable() == 1) {
140 $frame = ilFrameTargetInfo::_getFrame("MainContent");
141 }
142 break;
143
144 case "edit":
145 case "editContent":
146 $frame = ilFrameTargetInfo::_getFrame("MainContent");
147 break;
148
149 case "infoScreen":
150 $frame = ilFrameTargetInfo::_getFrame("MainContent");
151 break;
152
153 default:
154 $frame = "";
155 break;
156 }
157
158 return $frame;
159 }
160
161
170 public function getProperties()
171 {
172 global $DIC;
173 $lng = $DIC['lng'];
174 $rbacsystem = $DIC['rbacsystem'];
175 $props = parent::getProperties();
176
177 $editable = ilObjSAHSLearningModuleAccess::_lookupEditable($this->obj_id);
178
179 if ($editable) {
180 $props[] = array("alert" => true,
181 "value" => $lng->txt("authoring_mode"));
182 }
183
184 if ($rbacsystem->checkAccess("write", $this->ref_id)) {
185 $props[] = array("alert" => false, "property" => $lng->txt("type"),
186 "value" => $lng->txt("sahs"));
187 }
188
189 $certValidator = new ilCertificateDownloadValidator();
190 $allowed = $certValidator->isCertificateDownloadable($this->user->getId(), $this->obj_id);
191 if ($allowed) {
193 $lng->loadLanguageModule('certificate');
194 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->ref_id . "&cmd=downloadCertificate";
195 $props[] = [
196 'alert' => false,
197 'property' => $lng->txt('certificate'),
198 'value' => $DIC->ui()->renderer()->render(
199 $DIC->ui()->factory()->link()->standard($lng->txt('download_certificate'), $cmd_link)
200 )
201 ];
202 }
203
204 return $props;
205 }
206} // END class.ilObjCategoryGUI
user()
Definition: user.php:4
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Validates if an active certificate is stored in the database and can be downloaded by the user.
static _getFrame($a_class, $a_type='')
Get content frame name.
static _lookupEditable($a_obj_id)
Lookup editable.
Class ilObjSAHSLearningModuleListGUI.
getCommandLink($a_cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.
initItem($a_ref_id, $a_obj_id, $type, $a_title="", $a_description="")
inititialize new item (is called by getItemHTML())
getCommandFrame($a_cmd)
Get command target frame.
Class ilObjSCORMLearningModule.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _getCommands()
get commands
Class ilObjectListGUI.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46