ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjSAHSLearningModuleListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2005 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
35 include_once "Services/Object/classes/class.ilObjectListGUI.php";
36 
38 {
44  {
45  $this->ilObjectListGUI();
46  }
47 
53  function init()
54  {
55  $this->copy_enabled = false;
56  $this->delete_enabled = true;
57  $this->cut_enabled = true;
58  $this->subscribe_enabled = true;
59  $this->link_enabled = true;
60  $this->payment_enabled = true;
61  $this->info_screen_enabled = true;
62  $this->type = "sahs";
63  $this->gui_class_name = "ilobjsahslearningmodulegui";
64 
65  // general commands array
66  include_once('./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php');
68  }
69 
79  function getCommandLink($a_cmd)
80  {
81  switch($a_cmd)
82  {
83  case "view":
84  $cmd_link = null;
85  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
87  {
88  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id;
89  }
90  else
91  {
92  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
93  }
94  break;
95 
96  case "edit":
97  $cmd_link = "ilias.php?baseClass=ilSAHSEditGUI&amp;ref_id=".$this->ref_id;
98  break;
99 
100  case "infoScreen":
101  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
102  "&amp;cmd=infoScreen";
103  break;
104 
105  default:
106  $cmd_link = "repository.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
107  break;
108  }
109 
110  return $cmd_link;
111  }
112 
113 
121  function getCommandFrame($a_cmd)
122  {
123  global $ilias;
124 
125  switch($a_cmd)
126  {
127  case "view":
128  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
129  require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
130  $sahs_obj = new ilObjSAHSLearningModule($this->ref_id);
131  if(ilPaymentObject::_isBuyable($this->ref_id) &&
132  !ilPaymentObject::_hasAccess($this->ref_id))
133  {
134  $frame = '';
135  }
136  else
137  {
138  $frame = "ilContObj".$this->obj_id;
139  }
140  if ($sahs_obj->getEditable() == 1)
141  {
142  $frame = ilFrameTargetInfo::_getFrame("MainContent");
143  }
144  break;
145 
146  case "edit":
147  $frame = ilFrameTargetInfo::_getFrame("MainContent");
148  break;
149 
150  case "infoScreen":
151  $frame = ilFrameTargetInfo::_getFrame("MainContent");
152  break;
153 
154  default:
155  $frame = "";
156  break;
157  }
158 
159  return $frame;
160  }
161 
162 
171  function getProperties()
172  {
173  global $lng, $rbacsystem;
174 
175  $props = array();
176 
177  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
178 
179  $editable = ilObjSAHSLearningModuleAccess::_lookupEditable($this->obj_id);
180 
181  if (!$editable && !ilObjSAHSLearningModuleAccess::_lookupOnline($this->obj_id))
182  {
183  $props[] = array("alert" => true, "property" => $lng->txt("status"),
184  "value" => $lng->txt("offline"));
185  }
186  else if ($editable)
187  {
188  $props[] = array("alert" => true,
189  "value" => $lng->txt("authoring_mode"));
190  }
191 
192  if ($rbacsystem->checkAccess("write", $this->ref_id))
193  {
194  $props[] = array("alert" => false, "property" => $lng->txt("type"),
195  "value" => $lng->txt("sahs"));
196  }
197 
198  // check for certificates
200  {
201  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
203  switch ($type)
204  {
205  case "scorm":
206  $lng->loadLanguageModule('certificate');
207  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
208  "&amp;cmd=downloadCertificate";
209  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
210  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
211  break;
212  case "scorm2004":
213  $lng->loadLanguageModule('certificate');
214  $cmd_link = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->ref_id.
215  "&amp;cmd=downloadCertificate";
216  $props[] = array("alert" => false, "property" => $lng->txt("condition_finished"),
217  "value" => '<a href="' . $cmd_link . '">' . $lng->txt("download_certificate") . '</a>');
218  break;
219  }
220  }
221 
222  return $props;
223  }
224 
225 
226 } // END class.ilObjCategoryGUI
227 ?>