• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilias.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2005 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00036 class ILIAS
00037 {
00042         var $INI_FILE;
00043 
00049         var $dsn = "";
00050 
00056         var $db;
00057 
00063         var $tplPath = "./templates/";
00064 
00070         var $account;
00071 
00077         var $auth_params = array();
00078 
00084         var $auth;
00085 
00091         var $ini = array();
00092 
00098         var $error_obj;
00099 
00106         var $obj_factory;
00107 
00114         var $styles;
00115 
00122         var $skins;
00123         
00129         function ILIAS($a_client_id = 0)
00130         {
00131                 global $ilErr, $ilDB, $ilIliasIniFile, $ilClientIniFile, $ilAuth;
00132 
00133                 $this->ini_ilias =& $ilIliasIniFile;
00134                 $this->client_id = CLIENT_ID;
00135                 $this->ini =& $ilClientIniFile;
00136                 $this->db =& $ilDB;
00137                 $this->error_obj =& $ilErr;
00138                 $this->auth =& $ilAuth;
00139 
00140                 // create instance of object factory
00141                 require_once("classes/class.ilObjectFactory.php");
00142                 $this->obj_factory =& new ilObjectFactory();
00143         }
00144 
00150         function _ILIAS()
00151         {
00152                 if ($this->ini->readVariable("db", "type") != "")
00153                 {
00154                         $this->db->disconnect();
00155                 }
00156                 
00157                 return true;
00158         }
00159         
00160         
00167         function setAuthError($a_error_obj)
00168         {
00169                 $this->auth_error =& $a_error_obj;
00170         }
00171         
00175         function &getAuthError()
00176         {
00177                 return $this->auth_error;
00178         }
00179 
00188         function getSetting($a_keyword, $a_default_value = false)
00189         {
00190                 global $ilSetting;
00191                 
00192                 return $ilSetting->get($a_keyword, $a_default_value);
00193         }
00194         
00201         function deleteSetting($a_keyword)
00202         {
00203                 global $ilSetting;
00204                 
00205                 return $ilSetting->delete($a_keyword);
00206         }
00207 
00208 
00214         function getAllSettings()
00215         {
00216                 global $ilSetting;
00217                 
00218                 return $ilSetting->getAll();
00219         }
00220 
00230         function setSetting($a_key, $a_val)
00231         {
00232                 global $ilSetting;
00233                 
00234                 return $ilSetting->set($a_key, $a_val);
00235         }
00236 
00237 
00244         function getFirstStyle($a_skin)
00245         {
00246                 if (!is_array($this->styles))
00247                 {
00248                         $this->getStyles($a_skin);
00249                 }
00250 
00251                 return $this->styles[0]["name"];
00252         }
00253         
00260         function checkTemplate($a_name)
00261         {
00262                 return file_exists($this->tplPath.$a_name);
00263         }
00264 
00268         function &getCurrentUser()
00269         {
00270                 return $this->account;
00271         }
00272         
00273         function getClientId()
00274         {
00275                 return $this->client_id;
00276         }
00277         
00281         function raiseError($a_msg,$a_err_obj)
00282         {
00283                 global $ilErr;
00284 
00285                 $ilErr->raiseError($a_msg,$a_err_obj);
00286         }
00287 
00288 
00289 
00290 } // END class.ilias
00291 ?>

Generated on Fri Dec 13 2013 17:56:47 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1