ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
23 parent::__construct();
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
52 public function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
53 {
54 // general commands array
55 $this->commands = ilObjSAHSLearningModuleAccess::_getCommands($a_obj_id);
56 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
57 }
58
68 public function getCommandLink($a_cmd)
69 {
70 global $ilCtrl;
71 $cmd_link = null;
72 switch ($a_cmd) {
73 case "view":
74 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
76 if ($this->offline_mode) {
77 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeStart";
78 } else {
79 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id;
80 }
81 } else {
82 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id;
83 }
84
85 break;
86 case "offlineModeView":
87 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeView";
88 break;
89
90 case "editContent":
91 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=editContent";
92 break;
93
94 case "edit":
95 $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=" . $this->ref_id;
96 break;
97
98 case "infoScreen":
99 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=infoScreen";
100 break;
101
102 case "offlineModeStart":
103 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmd=offlineModeStart";
104// $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilsahspresentationgui', 'ilscormofflinemodegui'),'start&amp;ref_id='.$_GET["ref_id"]);
105 break;
106
107 case "offlineModeStop":
108 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id . "&amp;cmdClass=ilSCORMOfflineModeGUI&amp;cmd=stop";
109 break;
110
111 default:
112 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
113 $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
114 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
115 break;
116 }
117
118 return $cmd_link;
119 }
120
121
129 public function getCommandFrame($a_cmd)
130 {
131 global $ilias;
132
133 switch ($a_cmd) {
134 case "view":
135 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
136 $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
137 if ($this->offline_mode) {
138 $frame = ilFrameTargetInfo::_getFrame("MainContent");
139 } else {
140 $frame = "ilContObj" . $this->obj_id;
141 }
142 if ($sahs_obj->getEditable() == 1) {
143 $frame = ilFrameTargetInfo::_getFrame("MainContent");
144 }
145 break;
146
147 case "edit":
148 case "editContent":
149 $frame = ilFrameTargetInfo::_getFrame("MainContent");
150 break;
151
152 case "infoScreen":
153 $frame = ilFrameTargetInfo::_getFrame("MainContent");
154 break;
155
156 default:
157 $frame = "";
158 break;
159 }
160
161 return $frame;
162 }
163
164
173 public function getProperties()
174 {
175 global $lng, $rbacsystem;
176
177 $props = array();
178
179 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
180
181 $editable = ilObjSAHSLearningModuleAccess::_lookupEditable($this->obj_id);
182
183 if (!$editable && ilObjSAHSLearningModuleAccess::_isOffline($this->obj_id)) {
184 $props[] = array("alert" => true, "property" => $lng->txt("status"),
185 "value" => $lng->txt("offline"));
186 } elseif ($editable) {
187 $props[] = array("alert" => true,
188 "value" => $lng->txt("authoring_mode"));
189 }
190
191 if ($rbacsystem->checkAccess("write", $this->ref_id)) {
192 $props[] = array("alert" => false, "property" => $lng->txt("type"),
193 "value" => $lng->txt("sahs"));
194 }
195
196 // check for certificates
198 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
200 switch ($type) {
201 case "scorm":
202 $lng->loadLanguageModule('certificate');
203 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id .
204 "&amp;cmd=downloadCertificate";
205 $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
206 "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
207 break;
208 case "scorm2004":
209 $lng->loadLanguageModule('certificate');
210 $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->ref_id .
211 "&amp;cmd=downloadCertificate";
212 $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
213 "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
214 break;
215 }
216 }
217
218 return $props;
219 }
220} // END class.ilObjCategoryGUI
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static _getFrame($a_class, $a_type='')
Get content frame name.
static _lookupEditable($a_obj_id)
Lookup editable.
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static _lookupUserCertificate($obj_id, $usr_id=0)
Checks whether a certificate exists for the active user or not.
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, $a_title="", $a_description="")
inititialize new item
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