ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilias.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2005 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 
36 class ILIAS
37 {
42  var $INI_FILE;
43 
49  var $dsn = "";
50 
56  var $db;
57 
63  var $tplPath = "./templates/";
64 
70  var $account;
71 
77  var $auth_params = array();
78 
84  var $auth;
85 
91  var $ini = array();
92 
99 
107 
114  var $styles;
115 
122  var $skins;
123 
129  function ILIAS($a_client_id = 0)
130  {
131  global $ilErr, $ilDB, $ilIliasIniFile, $ilClientIniFile, $ilAuth;
132 
133  $this->ini_ilias =& $ilIliasIniFile;
134  $this->client_id = CLIENT_ID;
135  $this->ini =& $ilClientIniFile;
136  $this->db =& $ilDB;
137  $this->error_obj =& $ilErr;
138  $this->auth =& $ilAuth;
139 
140  // create instance of object factory
141  require_once("classes/class.ilObjectFactory.php");
142  $this->obj_factory =& new ilObjectFactory();
143  }
144 
150  function _ILIAS()
151  {
152  if ($this->ini->readVariable("db", "type") != "")
153  {
154  $this->db->disconnect();
155  }
156 
157  return true;
158  }
159 
160 
167  function setAuthError($a_error_obj)
168  {
169  $this->auth_error =& $a_error_obj;
170  }
171 
175  function &getAuthError()
176  {
177  return $this->auth_error;
178  }
179 
188  function getSetting($a_keyword, $a_default_value = false)
189  {
190  global $ilSetting;
191 
192  return $ilSetting->get($a_keyword, $a_default_value);
193  }
194 
201  function deleteSetting($a_keyword)
202  {
203  global $ilSetting;
204 
205  return $ilSetting->delete($a_keyword);
206  }
207 
208 
214  function getAllSettings()
215  {
216  global $ilSetting;
217 
218  return $ilSetting->getAll();
219  }
220 
230  function setSetting($a_key, $a_val)
231  {
232  global $ilSetting;
233 
234  return $ilSetting->set($a_key, $a_val);
235  }
236 
237 
244  function getFirstStyle($a_skin)
245  {
246  if (!is_array($this->styles))
247  {
248  $this->getStyles($a_skin);
249  }
250 
251  return $this->styles[0]["name"];
252  }
253 
260  function checkTemplate($a_name)
261  {
262  return file_exists($this->tplPath.$a_name);
263  }
264 
268  function &getCurrentUser()
269  {
270  return $this->account;
271  }
272 
273  function getClientId()
274  {
275  return $this->client_id;
276  }
277 
281  function raiseError($a_msg,$a_err_obj)
282  {
283  global $ilErr;
284 
285  $ilErr->raiseError($a_msg,$a_err_obj);
286  }
287 
288 
289 
290 } // END class.ilias
291 ?>