ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $tpl, $lng;
50 
51  if ($a_id != 0) {
52  $this->sc_object = new ilSCORMItem($a_id);
53  }
54  $this->tpl = $tpl;
55  $this->lng = $lng;
56  }
57 
63  public function &getInstance($a_id)
64  {
65  $object = new ilSCORMObject($a_id);
66  switch ($object->getType()) {
67  case "sit": // item
68  $item = new ilSCORMItemGUI($a_id);
69  return $item;
70  break;
71 
72  case "sos": // organizations
73  $sos_gui = new ilSCORMOrganizationsGUI($a_id);
74  return $sos_gui;
75  break;
76 
77  case "sor": // organization
78  $sor_gui = new ilSCORMOrganizationGUI($a_id);
79  return $sor_gui;
80  break;
81 
82  case "sma": // manifest
83  $sma_gui = new ilSCORMManifestGUI($a_id);
84  return $sma_gui;
85  break;
86 
87  case "srs": // resources
88  $srs_gui = new ilSCORMResourcesGUI($a_id);
89  return $srs_gui;
90  break;
91 
92  case "sre": // resource
93  $sre_gui = new ilSCORMResourceGUI($a_id);
94  return $sre_gui;
95  break;
96  }
97  }
98 
99 
100  public function displayParameter($a_name, $a_value)
101  {
102  $this->tpl->setCurrentBlock("parameter");
103  $this->tpl->setVariable("TXT_PARAMETER_NAME", $a_name);
104  $this->tpl->setVariable("TXT_PARAMETER_VALUE", $a_value);
105  $this->tpl->parseCurrentBlock();
106  }
107 }
Parent object for SCORM GUI objects.
GUI class for SCORM Organization element.
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.