ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjLanguageAccess.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 
38 {
50  function _checkTranslate()
51  {
52  global $lng, $ilSetting, $ilUser, $rbacsystem;
53 
54  if (!$ilSetting->get("lang_ext_maintenance")
55  or !$ilSetting->get("lang_translate_".$lng->getLangKey()))
56  {
57  return false;
58  }
59 
60  if ($ilUser->getId())
61  {
63  return $rbacsystem->checkAccess("read,write", (int) $ref_id);
64  }
65  return false;
66  }
67 
68 
77  function _checkMaintenance()
78  {
79  global $ilSetting, $ilUser, $rbacsystem;
80 
81  if (!$ilSetting->get("lang_ext_maintenance"))
82  {
83  return false;
84  }
85 
86  if ($ilUser->getId())
87  {
89  return $rbacsystem->checkAccess("read,write", (int) $ref_id);
90  }
91  return false;
92  }
93 
94 
102  {
103  global $ilDB;
104 
105  $q = "SELECT ref_id FROM object_reference r, object_data d".
106  " WHERE r.obj_id = d.obj_id AND d.type = ".$ilDB->quote("lngf", "text");
107  $set = $ilDB->query($q);
108  $row = $ilDB->fetchAssoc($set);
109  return $row['ref_id'];
110  }
111 
112 
120  function _lookupId($a_key)
121  {
122  global $ilDB;
123 
124  $q = "SELECT obj_id FROM object_data ".
125  " WHERE type = ".$ilDB->quote("lng", "text").
126  " AND title = ".$ilDB->quote($a_key, "text");
127  $set = $ilDB->query($q);
128  $row = $ilDB->fetchAssoc($set);
129  return $row['obj_id'];
130  }
131 }
132 
133 ?>