ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 {
22  {
23  $this->ilObjectListGUI();
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->payment_enabled = true;
39  $this->info_screen_enabled = true;
40  $this->type = "sahs";
41  $this->gui_class_name = "ilobjsahslearningmodulegui";
42 
43  // general commands array
44  include_once('./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
46  }
47 
57  function getCommandLink($a_cmd)
58  {
59  global $ilCtrl;
60 
61  switch($a_cmd)
62  {
63  case "view":
64  $cmd_link = null;
65  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
67  {
68  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id;
69  }
70  else
71  {
72  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
73  }
74  break;
75 
76  case "editContent":
77  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id."&amp;cmd=editContent";
78  break;
79 
80  case "edit":
81  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
82  break;
83 
84  case "infoScreen":
85  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
86  "&amp;cmd=infoScreen";
87  break;
88 
89  default:
90  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
91  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
92  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
93  break;
94  }
95 
96  return $cmd_link;
97  }
98 
99 
107  function getCommandFrame($a_cmd)
108  {
109  global $ilias;
110 
111  switch($a_cmd)
112  {
113  case "view":
114  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
115  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
116  $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
117  if(ilPaymentObject::_isBuyable($this->ref_id) &&
118  !ilPaymentObject::_hasAccess($this->ref_id))
119  {
120  $frame = '';
121  }
122  else
123  {
124  $frame = "ilContObj".$this->obj_id;
125  }
126  if ($sahs_obj->getEditable() == 1)
127  {
128  $frame = ilFrameTargetInfo::_getFrame("MainContent");
129  }
130  break;
131 
132  case "edit":
133  case "editContent":
134  $frame = ilFrameTargetInfo::_getFrame("MainContent");
135  break;
136 
137  case "infoScreen":
138  $frame = ilFrameTargetInfo::_getFrame("MainContent");
139  break;
140 
141  default:
142  $frame = "";
143  break;
144  }
145 
146  return $frame;
147  }
148 
149 
158  function getProperties()
159  {
160  global $lng, $rbacsystem;
161 
162  $props = array();
163 
164  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
165 
166  $editable = ilObjSAHSLearningModuleAccess::_lookupEditable($this->obj_id);
167 
168  if (!$editable && ilObjSAHSLearningModuleAccess::_isOffline($this->obj_id))
169  {
170  $props[] = array("alert" => true, "property" => $lng->txt("status"),
171  "value" => $lng->txt("offline"));
172  }
173  else if ($editable)
174  {
175  $props[] = array("alert" => true,
176  "value" => $lng->txt("authoring_mode"));
177  }
178 
179  if ($rbacsystem->checkAccess("write", $this->ref_id))
180  {
181  $props[] = array("alert" => false, "property" => $lng->txt("type"),
182  "value" => $lng->txt("sahs"));
183  }
184 
185  // check for certificates
187  {
188  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
189  $type = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
190  switch ($type)
191  {
192  case "scorm":
193  $lng->loadLanguageModule('certificate');
194  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
195  "&amp;cmd=downloadCertificate";
196  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
197  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
198  break;
199  case "scorm2004":
200  $lng->loadLanguageModule('certificate');
201  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
202  "&amp;cmd=downloadCertificate";
203  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
204  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
205  break;
206  }
207  }
208 
209  return $props;
210  }
211 
212 
213 } // END class.ilObjCategoryGUI
214 ?>