ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORMOrganizations.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 
35 {
37 
38 
45  function ilSCORMOrganizations($a_id = 0)
46  {
47  global $lng;
48 
49  // title should be overrriden by ilSCORMExplorer
50  $this->setTitle($lng->txt("cont_organizations"));
51 
52  parent::ilSCORMObject($a_id);
53  $this->setType("sos");
54  }
55 
57  {
59  }
60 
61  function setDefaultOrganization($a_def_org)
62  {
63  $this->default_organization = $a_def_org;
64  }
65 
66  function read()
67  {
68  global $ilDB;
69 
70  parent::read();
71 
72  $obj_set = $ilDB->queryF(
73  'SELECT default_organization FROM sc_organizations WHERE obj_id = %s',
74  array('integer'),
75  array($this->getId())
76  );
77  $obj_rec = $ilDB->fetchAssoc($obj_set);
78  $this->setDefaultOrganization($obj_rec["default_organization"]);
79  }
80 
81  function create()
82  {
83  global $ilDB;
84 
86 
87  $ilDB->manipulateF('
88  INSERT INTO sc_organizations (obj_id, default_organization) VALUES (%s, %s)',
89  array('integer', 'text'),
90  array($this->getId(), $this->getDefaultOrganization())
91  );
92  }
93 
94  function update()
95  {
96  global $ilDB;
97 
99 
100  $ilDB->manipulateF('
101  UPDATE sc_organizations
102  SET default_organization = %s
103  WHERE obj_id = %s',
104  array('text', 'integer'),
105  array($this->getDefaultOrganization(), $this->getId())
106  );
107  }
108 
109  function delete()
110  {
111  global $ilDB;
112 
113  parent::delete();
114 
115  $ilDB->manipulateF(
116  'DELETE FROM sc_organizations WHERE obj_id = %s',
117  array('integer'),
118  array($this->getId())
119  );
120  }
121 }
122 ?>