ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
5 include_once "Services/Object/classes/class.ilObjectListGUI.php";
6 
16 {
21  function __construct()
22  {
23  parent::__construct();
24  }
25 
31  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  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  function getCommandLink($a_cmd)
69  {
70  global $ilCtrl;
71  $cmd_link = null;
72  switch($a_cmd)
73  {
74  case "view":
75  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
77  {
78  if ($this->offline_mode) {
79  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id."&amp;cmd=offlineModeStart";
80  }
81  else {
82  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id;
83  }
84  }
85  else
86  {
87  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
88  }
89 
90  break;
91  case "offlineModeView":
92  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id."&amp;cmd=offlineModeView";
93  break;
94 
95  case "editContent":
96  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id."&amp;cmd=editContent";
97  break;
98 
99  case "edit":
100  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
101  break;
102 
103  case "infoScreen":
104  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id."&amp;cmd=infoScreen";
105  break;
106 
107  case "offlineModeStart":
108  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id."&amp;cmd=offlineModeStart";
109 // $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilsahspresentationgui', 'ilscormofflinemodegui'),'start&amp;ref_id='.$_GET["ref_id"]);
110  break;
111 
112  case "offlineModeStop":
113  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id."&amp;cmdClass=ilSCORMOfflineModeGUI&amp;cmd=stop";
114  break;
115 
116  default:
117  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
118  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
119  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
120  break;
121  }
122 
123  return $cmd_link;
124  }
125 
126 
134  function getCommandFrame($a_cmd)
135  {
136  global $ilias;
137 
138  switch($a_cmd)
139  {
140  case "view":
141  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
142  $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
143  if ($this->offline_mode) {
144  $frame = ilFrameTargetInfo::_getFrame("MainContent");
145  }
146  else {
147  $frame = "ilContObj".$this->obj_id;
148  }
149  if ($sahs_obj->getEditable() == 1)
150  {
151  $frame = ilFrameTargetInfo::_getFrame("MainContent");
152  }
153  break;
154 
155  case "edit":
156  case "editContent":
157  $frame = ilFrameTargetInfo::_getFrame("MainContent");
158  break;
159 
160  case "infoScreen":
161  $frame = ilFrameTargetInfo::_getFrame("MainContent");
162  break;
163 
164  default:
165  $frame = "";
166  break;
167  }
168 
169  return $frame;
170  }
171 
172 
181  function getProperties()
182  {
183  global $lng, $rbacsystem;
184 
185  $props = array();
186 
187  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
188 
189  $editable = ilObjSAHSLearningModuleAccess::_lookupEditable($this->obj_id);
190 
191  if (!$editable && ilObjSAHSLearningModuleAccess::_isOffline($this->obj_id))
192  {
193  $props[] = array("alert" => true, "property" => $lng->txt("status"),
194  "value" => $lng->txt("offline"));
195  }
196  else if ($editable)
197  {
198  $props[] = array("alert" => true,
199  "value" => $lng->txt("authoring_mode"));
200  }
201 
202  if ($rbacsystem->checkAccess("write", $this->ref_id))
203  {
204  $props[] = array("alert" => false, "property" => $lng->txt("type"),
205  "value" => $lng->txt("sahs"));
206  }
207 
208  // check for certificates
210  {
211  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
213  switch ($type)
214  {
215  case "scorm":
216  $lng->loadLanguageModule('certificate');
217  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
218  "&amp;cmd=downloadCertificate";
219  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
220  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
221  break;
222  case "scorm2004":
223  $lng->loadLanguageModule('certificate');
224  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
225  "&amp;cmd=downloadCertificate";
226  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
227  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
228  break;
229  }
230  }
231 
232  return $props;
233  }
234 
235 
236 } // END class.ilObjCategoryGUI
237 ?>
getCommandLink($a_cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.
$_GET["client_id"]
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
global $ilCtrl
Definition: ilias.php:18
static _getCommands()
get commands
Class ilObjectListGUI.
static _lookupEditable($a_obj_id)
Lookup editable.
Create styles array
The data for the language used.
static _getFrame($a_class, $a_type='')
Get content frame name.
global $lng
Definition: privfeed.php:17
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
Class ilObjSAHSLearningModuleListGUI.
getCommandFrame($a_cmd)
Get command target frame.
Class ilObjSCORMLearningModule.
static _lookupUserCertificate($obj_id, $usr_id=0)
Checks whether a certificate exists for the active user or not.