ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  public function __construct($a_id = 0)
46  {
47  global $DIC;
48  $lng = $DIC['lng'];
49 
50  // title should be overrriden by ilSCORMExplorer
51  $this->setTitle($lng->txt("cont_organizations"));
52 
53  parent::__construct($a_id);
54  $this->setType("sos");
55  }
56 
57  public function getDefaultOrganization()
58  {
60  }
61 
62  public function setDefaultOrganization($a_def_org)
63  {
64  $this->default_organization = $a_def_org;
65  }
66 
67  public function read()
68  {
69  global $DIC;
70  $ilDB = $DIC['ilDB'];
71 
72  parent::read();
73 
74  $obj_set = $ilDB->queryF(
75  'SELECT default_organization FROM sc_organizations WHERE obj_id = %s',
76  array('integer'),
77  array($this->getId())
78  );
79  $obj_rec = $ilDB->fetchAssoc($obj_set);
80  $this->setDefaultOrganization($obj_rec["default_organization"]);
81  }
82 
83  public function create()
84  {
85  global $DIC;
86  $ilDB = $DIC['ilDB'];
87 
88  parent::create();
89 
90  $ilDB->manipulateF(
91  '
92  INSERT INTO sc_organizations (obj_id, default_organization) VALUES (%s, %s)',
93  array('integer', 'text'),
94  array($this->getId(), $this->getDefaultOrganization())
95  );
96  }
97 
98  public function update()
99  {
100  global $DIC;
101  $ilDB = $DIC['ilDB'];
102 
103  parent::update();
104 
105  $ilDB->manipulateF(
106  '
107  UPDATE sc_organizations
108  SET default_organization = %s
109  WHERE obj_id = %s',
110  array('text', 'integer'),
111  array($this->getDefaultOrganization(), $this->getId())
112  );
113  }
114 
115  public function delete()
116  {
117  global $DIC;
118  $ilDB = $DIC['ilDB'];
119 
120  parent::delete();
121 
122  $ilDB->manipulateF(
123  'DELETE FROM sc_organizations WHERE obj_id = %s',
124  array('integer'),
125  array($this->getId())
126  );
127  }
128 }
__construct($a_id=0)
Constructor.
global $DIC
Definition: saml.php:7
$lng
Parent object for all SCORM objects, that are stored in table scorm_object.
update($pash, $contents, Config $config)
global $ilDB