ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
42  public $sc_object;
43  public $tpl;
44  public $lng;
45 
46 
47  public function __construct($a_id = 0)
48  {
49  global $DIC;
50  $tpl = $DIC['tpl'];
51  $lng = $DIC['lng'];
52 
53  if ($a_id != 0) {
54  $this->sc_object = new ilSCORMItem($a_id);
55  }
56  $this->tpl = $tpl;
57  $this->lng = $lng;
58  }
59 
65  public function &getInstance($a_id)
66  {
67  $object = new ilSCORMObject($a_id);
68  switch ($object->getType()) {
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  public 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 }
Parent object for SCORM GUI objects.
GUI class for SCORM Organization element.
global $DIC
Definition: saml.php:7
GUI class for SCORM Resource element.
& getInstance($a_id)
get instance of specialized GUI class
Parent object for all SCORM objects, that are stored in table scorm_object.
SCORM Item.
GUI class for SCORM Organizations element.
GUI class for SCORM Resources element.
displayParameter($a_name, $a_value)
GUI class for SCORM Items.