ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORMObjectGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 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 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
25 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItemGUI.php");
26 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMOrganizationsGUI.php");
27 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMOrganizationGUI.php");
28 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResourcesGUI.php");
29 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResourceGUI.php");
30 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMManifestGUI.php");
31 
41 {
43  var $tpl;
44  var $lng;
45 
46 
47  function ilSCORMObjectGUI($a_id = 0)
48  {
49  global $tpl, $lng;
50 
51  if($a_id != 0)
52  {
53  $this->sc_object =& new ilSCORMItem($a_id);
54  }
55  $this->tpl =& $tpl;
56  $this->lng =& $lng;
57  }
58 
64  function &getInstance($a_id)
65  {
66  $object = new ilSCORMObject($a_id);
67  switch($object->getType())
68  {
69  case "sit": // item
70  $item =& new ilSCORMItemGUI($a_id);
71  return $item;
72  break;
73 
74  case "sos": // organizations
75  $sos_gui =& new ilSCORMOrganizationsGUI($a_id);
76  return $sos_gui;
77  break;
78 
79  case "sor": // organization
80  $sor_gui =& new ilSCORMOrganizationGUI($a_id);
81  return $sor_gui;
82  break;
83 
84  case "sma": // manifest
85  $sma_gui =& new ilSCORMManifestGUI($a_id);
86  return $sma_gui;
87  break;
88 
89  case "srs": // resources
90  $srs_gui =& new ilSCORMResourcesGUI($a_id);
91  return $srs_gui;
92  break;
93 
94  case "sre": // resource
95  $sre_gui =& new ilSCORMResourceGUI($a_id);
96  return $sre_gui;
97  break;
98  }
99  }
100 
101 
102  function displayParameter($a_name, $a_value)
103  {
104  $this->tpl->setCurrentBlock("parameter");
105  $this->tpl->setVariable("TXT_PARAMETER_NAME", $a_name);
106  $this->tpl->setVariable("TXT_PARAMETER_VALUE", $a_value);
107  $this->tpl->parseCurrentBlock();
108  }
109 }
110 ?>